Last active
August 29, 2015 13:56
-
-
Save ramontristani/9203629 to your computer and use it in GitHub Desktop.
Express application configuration
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
module.exports = function(express, path, app) { | |
var root = path.normalize(__dirname + '../../../'); | |
app.configure(function() { | |
app.use(express.logger('dev')); // log all requests to the console | |
app.use(express.cookieParser()); // enable reading of cookies | |
app.use(express.json({ limit: '50mb' })); // set json request payload size | |
app.use(express.urlencoded({ limit: '50mb' })); // set query request payload size | |
app.use(express.static(path.join(root, 'public'))); // set relative site root | |
app.set('views', path.join(root, 'views')); // set view path | |
app.set('view engine', 'ejs'); // set EJS as templating engine | |
process.env.port = process.env.port = process.env.port || 3000; | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment