Minify CSS

This commit is contained in:
Bingus_Violet 2024-02-07 11:27:40 -06:00
parent 840885841e
commit 281c704db2
3 changed files with 9 additions and 1 deletions

View file

@ -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(`
<link rel="stylesheet" href="/style.css">

View file

@ -5,7 +5,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./style.css">
<link rel="stylesheet" href="/style.css">
<title>Violet's Purgatory</title>