Middleware for generic controller

This commit is contained in:
Daniel García Aubert 2019-10-01 10:54:26 +02:00
parent 51dd9a7999
commit 645e3a797f

View File

@ -2,6 +2,12 @@
module.exports = class GenericController { module.exports = class GenericController {
route (app) { route (app) {
app.options('*', (req, res) => res.end()); app.options('*', emptyResponse());
} }
}; };
function emptyResponse () {
return function emptyResponseMiddleware (req, res) {
res.end();
};
}