From 6a6fcd4be9f68570cb41566dd7578e208582dcae Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Thu, 18 Apr 2024 23:08:50 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20Set=20IS=5FSERVER?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index fa787441..b0a8335f 100644 --- a/server.js +++ b/server.js @@ -44,6 +44,9 @@ const port = process.env.PORT || (isDocker ? 8080 : 4000); /* Checks env var for host. If undefined, will use 0.0.0.0 */ const host = process.env.HOST || '0.0.0.0'; +/* Indicates for the webpack config, that running as a server */ +process.env.IS_SERVER = 'True'; + /* Attempts to get the users local IP, used as part of welcome message */ const getLocalIp = () => { const dnsLookup = util.promisify(dns.lookup); @@ -132,8 +135,8 @@ const app = express() } }) // Serves up static files - .use(express.static(path.join(__dirname, 'dist'))) .use(express.static(path.join(__dirname, process.env.USER_DATA_DIR || 'user-data'))) + .use(express.static(path.join(__dirname, 'dist'))) .use(express.static(path.join(__dirname, 'public'), { index: 'initialization.html' })) .use(history()) // If no other route is matched, serve up the index.html with a 404 status