🌐 Make server also host files, for when building for web

This commit is contained in:
Rune Harlyk
2024-02-04 00:56:37 +01:00
parent b9a1497fdf
commit acdafaa3cf
+4 -1
View File
@@ -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}`));