From e6b8ca0254e26aca0d3c16c773b5ed68b27d0f85 Mon Sep 17 00:00:00 2001 From: Ashley Date: Wed, 9 Nov 2022 17:54:00 +0100 Subject: [PATCH] Superinit!!! --- src/libpoketube/init/pages-static.js | 45 ++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/libpoketube/init/pages-static.js diff --git a/src/libpoketube/init/pages-static.js b/src/libpoketube/init/pages-static.js new file mode 100644 index 00000000..bb04038a --- /dev/null +++ b/src/libpoketube/init/pages-static.js @@ -0,0 +1,45 @@ + const { fetcher,core, wiki,musicInfo, modules, version, initlog, init,} = require("../libpoketube-initsys.js"); +const { + IsJsonString, + convert, + getFirstLine, + capitalizeFirstLetter, + turntomins, + getRandomInt, + getRandomArbitrary, +} = require("../ptutils/libpt-coreutils.js"); + +const sha384 = modules.hash; + +module.exports = function (app, config, renderTemplate) { +var html_location = './css/'; + +app.get("/privacy", function (req, res) { + renderTemplate(res, req, "priv.ejs"); +}); + +app.get("/143", function (req, res) { + var number_easteregg = getRandomArbitrary(0, 150); + + if (number_easteregg == "143") { + renderTemplate(res, req, "143.ejs"); + } + if (number_easteregg != "143") { + return res.redirect("/"); + } +}); + +app.get("/domains", function (req, res) { + renderTemplate(res, req, "domains.ejs"); +}); + +app.get("/license", function (req, res) { + renderTemplate(res, req, "license.ejs"); +}); + +app.get("/css/:id", (req, res) => { + res.sendFile(req.params.id, { root : html_location}); +}); + + +} \ No newline at end of file