router.js 602 B

1234567891011121314151617
  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('column', '/api/serve/column', controller.column); // index、create、show、destroy
  10. router.post('column', '/api/serve/column/update/:id', controller.column.update);
  11. // 信息表设置路由
  12. router.resources('news', '/api/serve/news', controller.news); // index、create、show、destroy
  13. router.post('news', '/api/serve/news/update/:id', controller.news.update);
  14. };