| 174 | // It's great for finding where a mystery endpoint is! |
| 175 | // The same is done for errors in the error-handling middleware. |
| 176 | const setupHandlerTraceMiddleware = app => app.use(function(req, res, next) { |
| 177 | const oldSend = res.send; |
| 178 | res.send = function() { |
| 179 | const result = oldSend.apply(this, arguments); |
| 180 | console.trace(); |
| 181 | return result; |
| 182 | }; |
| 183 | return next(); |
| 184 | }); |
| 185 | |
| 186 | const setupSecureMiddleware = function(app) { |
| 187 | // Cannot use express request `secure` property in production, due to |