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/lib/config/middleware.js

31 lines
801 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');
let middleware = [
// 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')),
];
module.exports = middleware;