import {getFormattedDate} from './functions.js';
export const logger = (configString) => (req, res, next) => {
let log = '';
switch (configString) {
case ':date':
log += getFormattedDate() + ' ';
case ':method':
log += `${req.method}` + ' ';
case ':url':
log += `${req.url}` + ' ';
default:
if (log !== '') {
console.log(log);
}
next();
}
}
Am I doing something wrong there? 'Cause I get both errors.