Created
August 16, 2016 13:32
-
-
Save savelee/77f173638941383f1d9ed4873e226c8c to your computer and use it in GitHub Desktop.
server/config/express.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'; | |
var express = require('express'); | |
var morgan = require('morgan'); | |
var compression = require('compression'); | |
var errorHandler = require('errorhandler'); | |
var path = require('path'); | |
var config = require('./index'); | |
module.exports = function(app) { | |
app.use(compression()); | |
//app.use(express.static(path.join(config.root, ''))); | |
app.set('appPath', path.join(config.root, 'server/views/')); // define the path of our app inside express to use across the server if needed | |
app.use(morgan('dev')); | |
app.use(errorHandler()); // error handler | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment