2017-03-26 06:53:54 +00:00
|
|
|
const throng = require('throng')
|
2017-08-13 00:23:40 +00:00
|
|
|
const createServer = require('./server/createServer')
|
2017-03-26 06:53:54 +00:00
|
|
|
|
|
|
|
const port = parseInt(process.env.PORT, 10) || 5000
|
|
|
|
|
|
|
|
throng({
|
|
|
|
workers: process.env.WEB_CONCURRENCY || 1,
|
2017-08-13 00:23:40 +00:00
|
|
|
lifetime: Infinity,
|
2017-08-17 18:56:57 +00:00
|
|
|
grace: 25000,
|
2017-08-13 00:23:40 +00:00
|
|
|
start: function (id) {
|
|
|
|
const server = createServer()
|
|
|
|
|
|
|
|
server.listen(port, function () {
|
|
|
|
console.log('Server #%s listening on port %s, Ctrl+C to stop', id, port)
|
|
|
|
})
|
|
|
|
}
|
2017-03-26 06:53:54 +00:00
|
|
|
})
|