diff --git a/index.js b/index.js index c6edb40..ecdf961 100644 --- a/index.js +++ b/index.js @@ -22,8 +22,6 @@ app.use("/fonts", express.static(fontPath)) app.use("/cached", express.static(cachePath)) app.get("/disc", (req, res) => { - var looping = true - res.setHeader("X-Accel-Buffering", "no") res.write(fs.readFileSync(path.join(__dirname, "resources/disc.html"))) @@ -41,8 +39,10 @@ app.get("/disc", (req, res) => { res.write(``) } setTimeout(() => { - loop() - res.write("") + if (!res.closed) { + loop() + res.write("") + } }, 1000); } loop() diff --git a/resources/disc.html b/resources/disc.html index 76821d1..c9a0ee1 100644 --- a/resources/disc.html +++ b/resources/disc.html @@ -12,9 +12,8 @@
-

Dynamicly Updating Discord Status

-

This page is basically the same as the one present on the site, but it updates in real time!

+

This page is basically the same as the one present on the site, but it updates in real time! It basically only exists to serve my brain rot :P


How does it work?

Its a little big buggy- Pretty much, it just keeps writing html to the client, and telling it the HTML never finished. Yeah. Not great. Very easily could cause a data leak i think? Idk, what do you think I am, a programmer????

\ No newline at end of file