mirror of
https://github.com/QuiteAFancyEmerald/Holy-Unblocker.git
synced 2025-05-15 21:00:00 -04:00
Removed unnecessary code.
This commit is contained in:
parent
60959a4815
commit
22f404793a
1 changed files with 5 additions and 10 deletions
|
@ -93,16 +93,11 @@ app.use(helmet({
|
||||||
// This takes one of those files and displays it for a site visitor.
|
// This takes one of those files and displays it for a site visitor.
|
||||||
// Query strings like /?j are converted into paths like /views/hidden.html
|
// 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.
|
// back here. Which query string converts to what is defined in routes.mjs.
|
||||||
router.get('/', async (req, res) => {
|
router.get('/', async (req, res) => res.send(paintSource(loadTemplates(tryReadFile(
|
||||||
const paramKey = Object.keys(req.query)[0];
|
// Return the index page if the query is not found.
|
||||||
const filePath = paramKey ? pages[paramKey] : pages.index;
|
// Also sets it as the default page.
|
||||||
|
path.join(__dirname, 'views', pages[Object.keys(req.query)[0] || 'index'] || pages.index)
|
||||||
const validPath = filePath || pages.index;
|
)))));
|
||||||
|
|
||||||
res.send(paintSource(loadTemplates(tryReadFile(
|
|
||||||
path.join(__dirname, 'views', validPath)
|
|
||||||
))));
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
app.use(router);
|
app.use(router);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue