From 281c704db253e10a653ca2322ad93f958c087ebc Mon Sep 17 00:00:00 2001 From: Bingus_Violet Date: Wed, 7 Feb 2024 11:27:40 -0600 Subject: [PATCH] Minify CSS --- index.js | 8 ++++++++ resources/mainPage.html | 2 +- {static => resources}/style.css | 0 3 files changed, 9 insertions(+), 1 deletion(-) rename {static => resources}/style.css (100%) diff --git a/index.js b/index.js index 340bf89..c997016 100644 --- a/index.js +++ b/index.js @@ -447,6 +447,14 @@ app.get('/', async (req, res) => { res.send(minify.minify(html)) }) +app.get('/style.css', async (req, res) => { + var cssPath = path.join(resourcePath, 'style.css') + var css = fs.readFileSync(cssPath).toString() + css = minify.minify(css) + res.send(css) + console.log(css) +}) + app.use((req, res, next) => { res.status(404).send(` diff --git a/resources/mainPage.html b/resources/mainPage.html index be01bdc..4979cb1 100644 --- a/resources/mainPage.html +++ b/resources/mainPage.html @@ -5,7 +5,7 @@ - + Violet's Purgatory diff --git a/static/style.css b/resources/style.css similarity index 100% rename from static/style.css rename to resources/style.css