This repository has been archived on 2018-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
crispy-train/app/config/middleware.js

31 lines
810 B
JavaScript
Raw Normal View History

2016-01-25 09:19:28 -05:00
'use strict';
// -----------------------------------------------------------------------------
// Middleware
// -----------------------------------------------------------------------------
const bodyParser = require('body-parser'),
cookieParser = require('cookie-parser'),
express = require('express'),
helmet = require('helmet'),
requestLogger = require('morgan'),
path = require('path');
2016-02-18 21:50:45 -05:00
let middleware = new Set([
2016-01-25 09:19:28 -05:00
// some security settings controlled by helmet
helmet.frameguard(),
helmet.hidePoweredBy(),
helmet.ieNoOpen(),
helmet.noSniff(),
helmet.xssFilter(),
// basic express middleware
requestLogger('combined'),
bodyParser.json(),
bodyParser.urlencoded({ extended: false }),
cookieParser(),
express.static(path.join(__dirname, '../../public')),
2016-02-18 21:50:45 -05:00
]);
2016-01-25 09:19:28 -05:00
module.exports = middleware;