'use strict'; module.exports = app => { const { router, controller } = app; const profix = '/api/question/'; const target = 'answer'; const user = app.middleware.user(); router.get(target, `${profix}${target}/getAnswer`, controller[target].getAnswer); router.resources(target, `${profix}${target}`, user, controller[target]); // index、create、show、destroy router.post(target, `${profix}${target}/update/:id`, controller[target].update); };