Skip to content

Commit

Permalink
⚡ Set IS_SERVER
Browse files Browse the repository at this point in the history
  • Loading branch information
Lissy93 committed Apr 18, 2024
1 parent b711f77 commit 6a6fcd4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6a6fcd4

Please sign in to comment.