router.js 385 B

12345678910111213
  1. 'use strict';
  2. /**
  3. * @param {Egg.Application} app - egg application
  4. */
  5. module.exports = app => {
  6. const { router, controller } = app;
  7. router.get('/', controller.home.index);
  8. // 科目表设置路由
  9. router.resources('subject', '/api/subject', controller.subject); // index、create、show、destroy
  10. router.post('subject', '/api/subject/:id', controller.subject.update);
  11. };