From e2fd72b8ba90826c1101e74d926c79c05312121d Mon Sep 17 00:00:00 2001 From: 00Fjongl <65314359+00Fjongl@users.noreply.github.com> Date: Mon, 8 Jul 2024 12:40:18 -0500 Subject: [PATCH] Slight change to path logic. --- src/server.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server.mjs b/src/server.mjs index f6c71313..93f32601 100644 --- a/src/server.mjs +++ b/src/server.mjs @@ -94,9 +94,9 @@ app.use(helmet({ // Query strings like /?j are converted into paths like /views/hidden.html // back here. Which query string converts to what is defined in routes.mjs. router.get('/', async (req, res) => res.send(paintSource(loadTemplates(tryReadFile( -// Return the index page if the query is not found. -// Also sets it as the default page. - path.join(__dirname, 'views', pages[Object.keys(req.query)[0] || 'index'] || pages.index) +// Return the index page if the query is not found, as there is no +// undefined page in routes.mjs. Also sets it as the default page. + path.join(__dirname, 'views', pages[Object.keys(req.query)[0]] || pages.index) )))));