DAVIDS/bin/www

25 lines
542 B
Text
Raw Normal View History

2016-04-17 11:21:26 +02:00
#!/usr/bin/env node
'use strict';
require('dotenv').config({silent: true});
var throng = require('throng');
var WORKERS = process.env.WEB_CONCURRENCY || 1;
function start() {
var app = require('../app');
// Specify listen port
app.set('port', process.env.PORT || 3000);
// Start listening
var server = app.listen(app.get('port'), function () {
var port = server.address().port;
console.log('Listening on %s', port);
});
}
throng({
workers: WORKERS,
lifetime: Infinity,
start: start
});