From 2e20608cc13a82b3fe1e513bebef36cd149218a6 Mon Sep 17 00:00:00 2001 From: Bingus_Violet Date: Thu, 25 Jan 2024 22:27:32 -0600 Subject: [PATCH] Generates on load now :) --- index.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/index.js b/index.js index 45574ce..09a0316 100644 --- a/index.js +++ b/index.js @@ -44,6 +44,10 @@ app.listen(PORT, () => { console.log("Violet's Purgatory is now listening on port: " + PORT) }) +app.get('/', (req, res) => { + res.send(pageUpdate()) +}) + function pageUpdate() { var statuses = { "online": { @@ -261,12 +265,10 @@ function pageUpdate() { html = '\n' + html html = html.replace("{THUMBOR}", getThumbor()) - // fetch('https://github.com/Violets-puragtory/Violets-Purgatory.dev') - // .then(((data) => data.text())) - // .then((text) => { - // console.log(text) - // }) - fs.writeFileSync(path.join(__dirname, 'static/index.html'), html) + + // fs.writeFileSync(path.join(__dirname, 'static/index.html'), html) + + return html } // Lanyard Stuffs @@ -298,8 +300,6 @@ lanyard.addEventListener("message", (res) => { } }) -pageUpdate() - app.use((req, res, next) => { res.status(404).send(`