Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vitorhidalgo/f161d674d478331f4aaa684209e23a6a to your computer and use it in GitHub Desktop.
Save vitorhidalgo/f161d674d478331f4aaa684209e23a6a to your computer and use it in GitHub Desktop.
config/express.js
var express = require('express');
var load = require('express-load');
var bodyParser = require('body-parser');
var namespace = require('express-namespace');
module.exports = function()
{
var app = express();
app.set('port', process.env.PORT || 3000);
app.use(bodyParser.json());
app.set('view engine', 'ejs');
app.set('views', './app/views');
load('models', { cwd: 'app' })
.then('controllers')
.then('routes')
.into(app);
return app;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment