A Deno-powered backend service for Plants vs. Zombies: MODDED. [Read-only GitHub mirror] docs.pvzm.net
express typescript expressjs plant deno jspvz pvzm game online backend plants-vs-zombies zombie javascript plants modded vs plantsvszombies openapi pvz noads
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix USE_TEST_UI doing nothing

Clay d6e38258 ba43473b

+12 -4
+12 -4
modules/public_folder.ts
··· 14 14 } else { 15 15 console.error(`Error creating public folder: ${(error as Error).message}`); 16 16 } 17 - } // add conditional route handlers BEFORE static file serving 17 + } 18 + 19 + // add conditional route handlers BEFORE static file serving 18 20 if (!config.useTestUI) { 19 - app.get("/index.html", (_req: any, res: any) => { 20 - res.status(404).send("Test UI is disabled"); 21 + // express.static serves index.html for "/" by default; block that too. 22 + app.get(["/", "/index.html"], (_req: any, res: any) => { 23 + res.redirect(config.gameUrl); 21 24 }); 22 25 } 23 26 ··· 27 30 }); 28 31 } 29 32 30 - app.use(express.static(config.publicFolderPath)); 33 + app.use( 34 + express.static(config.publicFolderPath, { 35 + // prevent "/" from implicitly serving index.html when the test UI is disabled. 36 + index: config.useTestUI ? "index.html" : false, 37 + }), 38 + ); 31 39 }