Update index.ts

This commit is contained in:
Munchy 2025-03-17 12:49:24 -04:00 committed by GitHub
parent d4af74f60e
commit 430fedf594
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -99,10 +99,6 @@ const instances = JSON.parse(
readFileSync(process.env.JANK_INSTANCES_PATH || __dirname + "/webpage/instances.json").toString(),
) as instace[];
const manifest = JSON.parse(
readFileSync(process.env.JANK_INSTANCES_PATH || __dirname + "/webpage/manifest.json").toString(),
) as object;
const instanceNames = new Map<string, Instance>();
for (const instance of instances) {
@ -187,11 +183,6 @@ app.use("/", async (req: Request, res: Response) => {
return;
}
if (req.path.startsWith("/manifest.json")) {
res.json(manifest);
return;
}
if (req.path.startsWith("/invite/")) {
res.sendFile(path.join(__dirname, "webpage", "invite.html"));
return;
@ -202,7 +193,7 @@ app.use("/", async (req: Request, res: Response) => {
app.set("trust proxy", (ip: string) => ip.startsWith("127."));
const PORT = process.env.PORT || Number(process.argv[2]) || 8333;
const PORT = process.env.PORT || Number(process.argv[2]) || 8080;
app.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});