From 9b9eab70fb65264dccb273dea8b5073b6c13d7eb Mon Sep 17 00:00:00 2001 From: Brian Donovan <1938+eventualbuddha@users.noreply.github.com> Date: Wed, 13 Jan 2021 14:11:59 -0800 Subject: [PATCH] refactor(all): re-sync prodserver config Also changes the output message to include a URL to make it clickable in some terminals. --- apps/bas/prodserver/index.js | 11 ++++++++++- apps/bmd/prodserver/index.js | 12 ++++-------- apps/bsd/prodserver/index.js | 8 +------- apps/election-manager/prodserver/index.js | 2 +- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/apps/bas/prodserver/index.js b/apps/bas/prodserver/index.js index 35922c38b3..555e21c47a 100644 --- a/apps/bas/prodserver/index.js +++ b/apps/bas/prodserver/index.js @@ -11,7 +11,16 @@ const proxy = require('../src/setupProxy') const app = express() const port = 3000 +app.use((req, res, next) => { + res.set('Cache-Control', 'no-store, no-cache, must-revalidate, private') + next() +}) + proxy(app) + app.use('/', express.static('../build')) +app.get('*', (req, res) => { + res.sendFile(path.join(__dirname, '../build/index.html')) +}) -app.listen(port, () => console.log(`BMD listening on port ${port}!`)) +app.listen(port, () => console.log(`BAS running at http://localhost:${port}/`)) diff --git a/apps/bmd/prodserver/index.js b/apps/bmd/prodserver/index.js index 069029a8ca..6f7de43cf8 100644 --- a/apps/bmd/prodserver/index.js +++ b/apps/bmd/prodserver/index.js @@ -17,13 +17,9 @@ app.use((req, res, next) => { }) proxy(app) -app.get('/machine-config', (req, res) => { - res.json({ - "appMode": process.env.VX_APP_MODE || "VxMark", - "machineId": process.env.VX_MACHINE_ID || "000", - }) -}) - app.use('/', express.static('../build')) +app.get('*', (req, res) => { + res.sendFile(path.join(__dirname, '../build/index.html')) +}) -app.listen(port, () => console.log(`BMD listening on port ${port}!`)) +app.listen(port, () => console.log(`BMD running at http://localhost:${port}/`)) diff --git a/apps/bsd/prodserver/index.js b/apps/bsd/prodserver/index.js index d0061d3934..3266905f42 100644 --- a/apps/bsd/prodserver/index.js +++ b/apps/bsd/prodserver/index.js @@ -24,10 +24,4 @@ app.get('*', (req, res) => { res.sendFile(path.join(__dirname, '../build/index.html')) }) -app.get('/machine-config', (req, res) => { - res.json({ - "machineId": process.env.VX_MACHINE_ID || "0000", - }) -}) - -app.listen(port, () => console.log(`BSD listening on port ${port}!`)) +app.listen(port, () => console.log(`BSD running at http://localhost:${port}/`)) diff --git a/apps/election-manager/prodserver/index.js b/apps/election-manager/prodserver/index.js index bcd0f30ddd..af97dc8145 100644 --- a/apps/election-manager/prodserver/index.js +++ b/apps/election-manager/prodserver/index.js @@ -24,4 +24,4 @@ app.get('*', (req, res) => { res.sendFile(path.join(__dirname, '../build/index.html')) }) -app.listen(port, () => console.log(`Election Manager listening on port ${port}!`)) +app.listen(port, () => console.log(`Election Manager running at http://localhost:${port}/`))