🧪 Example Middleware (factory)
1// middlewares/auth.js2export default () => (req, res, next) => {3 if (!req.headers.authorization) {4 return res.status(401).send("Unauthorized");5 }6 next();7};
1// middlewares/auth.js2export default () => (req, res, next) => {3 if (!req.headers.authorization) {4 return res.status(401).send("Unauthorized");5 }6 next();7};