SHOW:
|
|
- or go back to the newest paste.
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 | - | }, |
26 | + | |
27 | - | customMiddleware: function (app) { |
27 | + | myMiddleware: function (app) { |
28 | - | app.use(express.static(__dirname + '/swagger-ui/')); |
28 | + | app.use(express.static(__dirname + '/swagger-ui/')); |
29 | } | |
30 | } | |
31 | }; |