function logger(req, res, next) { console.log(`${req.method} ${req.url}`); next(); }
app.use('/user', userRouter);
function logger(req, res, next) { console.log(`Request Method: ${req.method}`); next(); } app.use(logger);
const cors = require('cors'); app.use(cors());
module.exports = function (req, res, next{ console.log('Logger Middleware'); next(); }; const logger = require('./middlewares/logger'); app.use(logger);