1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-01 00:08:27 +01:00
unleash.unleash/lib/middleware/request-logger.js
ivaosthu 9fdb948c69 Implement cookie-session support.
Sessions will be required to solve admin-auth.

I also refactored a few middlewares into seperate
files to make the code easier to read.

closes #262
2017-11-16 15:41:33 +01:00

13 lines
283 B
JavaScript

'use strict';
const logger = require('../logger')('HTTP');
module.exports = function(config) {
return (req, res, next) => {
next();
if (config.enableRequestLogger) {
logger.info(`${res.statusCode} ${req.method} ${req.baseUrl}`);
}
};
};