Skip to content

Instantly share code, notes, and snippets.

@getchenge
Created June 23, 2014 14:56
Show Gist options
  • Save getchenge/af36a425e74203ece0ec to your computer and use it in GitHub Desktop.
Save getchenge/af36a425e74203ece0ec to your computer and use it in GitHub Desktop.
the entrance
'use strict';
var express = require('express');
/**
* Main application file
*/
// Set default node environment to development
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
var config = require('./lib/config/config');
// Setup Express
var app = express();
require('./lib/config/express')(app);
require('./lib/routes')(app);
// Start server
app.listen(config.port, config.ip, function () {
console.log('Express server listening on %s:%d, in %s mode', config.ip, config.port, app.get('env'));
});
// Expose app
module.exports = app;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment