answer.js 461 B

123456789101112
  1. 'use strict';
  2. module.exports = app => {
  3. const { router, controller } = app;
  4. const profix = '/api/question/';
  5. const target = 'answer';
  6. const user = app.middleware.user();
  7. router.get(target, `${profix}${target}/getAnswer`, controller[target].getAnswer);
  8. router.resources(target, `${profix}${target}`, user, controller[target]); // index、create、show、destroy
  9. router.post(target, `${profix}${target}/update/:id`, controller[target].update);
  10. };