我正在尝试在此information之后向服务添加自定义中间件。这是我的代码:
module.exports = function (app) {
const Model = createModel(app);
const paginate = app.get('paginate');
function retrieveConnInfo(req, res, next) {
console.log(req, res);
next();
}
const options = {
Model,
paginate
};
app.use('/actions', retrieveConnInfo, createService(options));
const service = app.service('actions');
service.hooks(hooks);
};
有什么想法我在做什么错吗?