From acdafaa3cfa5dff319512d23762d562c6c879d12 Mon Sep 17 00:00:00 2001 From: Rune Harlyk Date: Sun, 4 Feb 2024 00:56:37 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=90=20Make=20server=20also=20host=20fi?= =?UTF-8?q?les,=20for=20when=20building=20for=20web?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mock/server.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mock/server.js b/mock/server.js index 80d535f..5591607 100644 --- a/mock/server.js +++ b/mock/server.js @@ -326,5 +326,8 @@ app.post("/system/stop", (req, res) => { model.running = false; model.res.send(settings); }); - +app.get("/", function (req, res) { + res.status(200).sendFile(`/`, { root: path }); +}); +app.get("*.*", express.static(path, { maxAge: "1y" })); app.listen(port, () => console.log(`Open at http://localhost:${port}`));