url scheme done, switch between apps and orgs mostly done

This commit is contained in:
metacryst
2026-01-12 14:10:17 -06:00
parent 434ecac47a
commit 419c8b1151
20 changed files with 406 additions and 215 deletions

View File

@@ -12,7 +12,8 @@ export default class Network {
id: z.number(),
name: z.string(),
apps: z.array(z.string()),
logo: z.string()
logo: z.string(),
abbreviation: z.string()
})
.strict()

View File

@@ -97,9 +97,14 @@ class Server {
});
return match ? path.join(dir, match) : null;
}
let filePath = getFileByNumber(path.join(this.DBPath, "images"), path.basename(req.url))
res.sendFile(filePath)
let filePath = path.join(this.DBPath, "images", path.basename(req.url))
if(filePath) {
res.sendFile(filePath)
} else {
return res.status(404).json({error: "Can't find image"})
}
}
get = async (req, res) => {