poke/src/libpoketube/init/pages-static.js

62 lines
1.4 KiB
JavaScript
Raw Normal View History

2022-12-19 12:52:57 +01:00
const {
fetcher,
core,
wiki,
musicInfo,
modules,
version,
initlog,
init,
} = require("../libpoketube-initsys.js");
2022-11-09 17:54:00 +01:00
const {
IsJsonString,
convert,
getFirstLine,
capitalizeFirstLetter,
turntomins,
getRandomInt,
getRandomArbitrary,
} = require("../ptutils/libpt-coreutils.js");
const sha384 = modules.hash;
module.exports = function (app, config, renderTemplate) {
2022-12-19 12:52:57 +01:00
var html_location = "./css/";
app.get("/privacy", function (req, res) {
2023-02-20 16:44:30 +01:00
if ( req.hostname == "poketube.fun" || req.hostname == "poketube.site" || req.hostname == "poketube.online" || req.hostname == "poketube.xyz" ) {
2022-12-19 12:52:57 +01:00
renderTemplate(res, req, "priv.ejs");
2023-02-20 16:44:30 +01:00
} else {
renderTemplate(res, req, "priv-custom.ejs");
}
2022-12-19 12:52:57 +01:00
});
app.get("/143", function (req, res) {
var number_easteregg = getRandomArbitrary(0, 143);
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");
});
2022-12-27 00:54:55 +01:00
app.get("/credits", function (req, res) {
renderTemplate(res, req, "want-you-gone.ejs");
});
2022-12-19 12:52:57 +01:00
app.get("/css/:id", (req, res) => {
res.sendFile(req.params.id, { root: html_location });
});
2023-02-09 17:36:57 +01:00
2022-12-19 12:52:57 +01:00
};