const debug = require('debug')('node-express-base'); const libs = `${process.cwd()}/libs`; const config = require(`${libs}/config`); const log = require(`${libs}/log`)(module); const app = require(`${libs}/app`); // Set default port: first environment variable PORT, then configuration and last 3000 app.set('port', process.env.PORT || config.port || 3000); // Set default ip: first environment variable IOP, then configuration and last '127.0.0.1' app.set('ip', process.env.IP || config.ip || '127.0.0.1'); const server = app.listen(app.get('port'), () => { log.info(`Express server listening on port ${server.address().port}`); });