Skip to content

Commit

Permalink
Merge pull request #145 from votingworks/refactor/all/prodserver
Browse files Browse the repository at this point in the history
refactor(all): re-sync prodserver config
  • Loading branch information
eventualbuddha authored Jan 14, 2021
2 parents 8587246 + 9b9eab7 commit e3f6765
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 17 deletions.
11 changes: 10 additions & 1 deletion apps/bas/prodserver/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}/`))
12 changes: 4 additions & 8 deletions apps/bmd/prodserver/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}/`))
8 changes: 1 addition & 7 deletions apps/bsd/prodserver/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}/`))
2 changes: 1 addition & 1 deletion apps/election-manager/prodserver/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}/`))

0 comments on commit e3f6765

Please sign in to comment.