Open
Description
I am having issues with method-override. I'm not sure where how to server.use it because version 2.2.2 doesn't have an app.requestBeforeRoute() function. Where are the hooks in v2.2.2?
I also tried putting it in the options.onconfig() function like this... (the code inside the methodOverride function came from one of method-override's examples here. https://www.npmjs.com/package/method-override )
options = {
onconfig: function (config, next) {
/*
* Add any additional config setup or overrides here. `config` is an initialized
* `confit` (https://github.com/krakenjs/confit/) configuration object.
*/
app.use(methodOverride(function(req, res) {
debugger;
if (req.body && typeof req.body === 'object' && '_method' in req.body) {
var method = req.body._method;
return method;
}
}));
next(null, config);
}
};
Obviously, this didn't work. What am I missing?
Metadata
Assignees
Labels
No labels