diff --git a/frontend/run/server.js b/frontend/run/server.js index 8a3f54557..c935009d8 100644 --- a/frontend/run/server.js +++ b/frontend/run/server.js @@ -1,3 +1,4 @@ +/* // Imports const express = require('express') const serveStatic = require('serve-static') @@ -13,3 +14,22 @@ app.listen(port) // eslint-disable-next-line no-console console.log(`http://frontend:${port} server started.`) +*/ + +const express = require('express') +const path = require('path') + +const hostname = '127.0.0.1' +const port = process.env.PORT || 3000 + +const app = express() +app.use(express.static(path.join(__dirname, '../dist'))) + +app.get('*', (req, res) => { + res.sendFile(__dirname, '../dist/index.html') +}) + +app.listen(port, hostname, () => { + // eslint-disable-next-line no-console + console.log('Listening at http://%s:%s/', hostname, port) +})