DAVIDS/bin/www

24 lines
542 B
JavaScript

#!/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
});