| | |
| | | app.use(methodOverride()); |
| | | app.use(cookieParser()); |
| | | if ('production' === env || 'dev' === env || 'test' === env) { |
| | | // app.use(express.static(path.join(config.root, 'public'))); |
| | | // app.set('appPath', path.join(config.root, 'public')); |
| | | app.use(morgan('dev')); |
| | | } |
| | | |
| | | if ('development' === env || 'test' === env) { |
| | | app.use(require('connect-livereload')()); |
| | | app.use(express.static(path.join(config.root, '.tmp'))); |
| | | app.use(express.static(path.join(config.root, 'client'))); |
| | | app.set('appPath', path.join(config.root, 'client')); |
| | | } else { |
| | | // else 'development' |
| | | app.use(morgan('dev')); |
| | | app.use(errorHandler()); // Error handler - has to be last |
| | | } |