ES6 class for generic controller

This commit is contained in:
Daniel García Aubert 2019-10-01 10:27:17 +02:00
parent a63c79fdd8
commit 88451f824f

View File

@ -1,14 +1,7 @@
'use strict'; 'use strict';
function GenericController() { module.exports = class GenericController {
} route (app) {
app.options('*', (req, res) => res.end());
GenericController.prototype.route = function (app) { }
app.options('*', this.handleRequest.bind(this));
}; };
GenericController.prototype.handleRequest = function(req, res) {
res.end();
};
module.exports = GenericController;