Skip to content

Commit

Permalink
Slight change to path logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
00Fjongl committed Jul 8, 2024
1 parent 22f4047 commit e2fd72b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/server.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)))));


Expand Down

0 comments on commit e2fd72b

Please sign in to comment.