Created
August 16, 2016 13:27
-
-
Save savelee/a8f7b74cafeed5e84c92102d29978161 to your computer and use it in GitHub Desktop.
server/app.js
This file contains 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
'use strict'; | |
// Set default node environment to development | |
process.env.NODE_ENV = process.env.NODE_ENV || 'development'; | |
var express = require('express'); | |
var config = require('./config'); | |
// Setup server | |
var app = express(); | |
var http = require('http'); | |
// Express configuration | |
require('./config/express')(app); | |
// Route configutation | |
require('./routes')(app); | |
// Start server | |
http.createServer(app).listen(config.port, function () { | |
console.log('Express server listening on %d, in %s mode', config.port, app.get('env')); | |
}); | |
// Expose app | |
exports = module.exports = app; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment