unpkg/server.js

18 lines
424 B
JavaScript
Raw Normal View History

const throng = require('throng')
2017-08-13 00:23:40 +00:00
const createServer = require('./server/createServer')
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,
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)
})
}
})