Advertisement
francfooter

Untitled

Mar 17th, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  var express = require('express');
  2. module.exports.http = {
  3.  
  4.   middleware: {
  5.     order: [
  6.       'startRequestTimer',
  7.       'cookieParser',
  8.       'session',
  9.       'myRequestLogger',
  10.       'myMiddleware',
  11.       'bodyParser',
  12.       'handleBodyParserError',
  13.       'compress',
  14.       'methodOverride',
  15.       'poweredBy',
  16.       '$custom',
  17.       'router',
  18.       'www',
  19.       'favicon',
  20.       '404',
  21.       '500'
  22.     ],
  23.     myRequestLogger: function (req, res, next) {
  24.       console.log("Requested :: ", req.method, req.url);
  25.       return next();
  26.     }
  27.     myMiddleware: function (app) {
  28.        app.use(express.static(__dirname + '/swagger-ui/'));
  29.     }
  30.   }
  31. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement