From 20b245281502d49bc194900816522cadd9657069 Mon Sep 17 00:00:00 2001 From: Oliver Boehlk Date: Sat, 18 Apr 2020 02:33:12 +0200 Subject: [PATCH] bugfix lets try this --- backend/index.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/backend/index.js b/backend/index.js index 9e6fc7c..32904c8 100644 --- a/backend/index.js +++ b/backend/index.js @@ -23,15 +23,19 @@ async function loadData() { } loadData(); -app.all("*", function (req, res, next) { +app.get("*", function (req, res, next) { if (!serverStartupComplete) return res.send("Server is starting..."); else return next(); }); -app.all("*", function (req, res, next) { +app.use(express.static(path.join(__dirname, 'frontend'))); + + +app.use(express.static(`${__dirname}/./frontend`)); +app.all("/", function (req, res, next) { if (!/^\/API\/.*/.test(req.url)) { - return res.sendFile(path.join(__dirname, './frontend/index.html')); + return res.sendFile(path.join(__dirname, 'frontend', 'index.html')); } else return next(); })