From 03a4d103ebb4c816fc8afb5b6e7b466d852a1077 Mon Sep 17 00:00:00 2001 From: Oliver Boehlk Date: Sat, 18 Apr 2020 01:01:06 +0200 Subject: [PATCH] host compiled files --- backend/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/index.js b/backend/index.js index 0fbb3f1..b03386d 100644 --- a/backend/index.js +++ b/backend/index.js @@ -26,6 +26,12 @@ app.all("*", function (req, res, next) { if (!serverStartupComplete) return res.send("Server is starting..."); else return next(); +}); + +app.all("*", function (req, res, next) { + if (!/^\/API\/.*/.test(req.url)) { + return res.sendFile(path.join(__dirname, './frontend/index.html')); + } else return next(); }) app.get('/API/day', function (req, res) {