foxy-moxy/run.js
2017-06-12 18:42:24 -07:00

13 lines
375 B
JavaScript

const cluster = require('express-cluster')
const app = require('./server.js')
const activePort = process.env.PORT || 3000
cluster((worker) => {
app.listen(activePort, () => {
console.log('worker ' + worker.id + ' is listening on port ' + activePort)
})
}, {
'respawn': true, // workers will restart on failure
'verbose': true // logs what happens to console
})