Created
May 20, 2016 20:53
-
-
Save stewhouston/8ed61cab3cde5db506d72ecf53485597 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @note start server with pm2 in production | |
module.exports = (function() { | |
const argv = require('yargs').argv; | |
const env = argv.env || process.env.NODE_ENV || 'dev'; | |
const port = <number> argv.port || 3000; | |
var app = require('express')(); | |
const octvConfig = require('./octv.environments')(env); | |
const bootstrap = require('./bootstrap'); | |
bootstrap(app, octvConfig); | |
let server = app.listen(port, function () { | |
console.log('App serving at http://%s:%s', server.address().address, server.address().port); | |
console.log('Current environment is:', env); | |
}) | |
.on('error', function() { | |
console.log('Application server error:', { 'args': arguments }); | |
}); | |
return server; | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment