news.js 434 B

1234567891011
  1. 'use strict';
  2. module.exports = app => {
  3. const { router, controller, config } = app;
  4. const profix = `/api${config.appName ? `/${config.appName}` : ''}`;
  5. const index = 'system';
  6. const target = 'news';
  7. router.resources(target, `${profix}/${index}/${target}`, controller[index][target]); // index、create、show、destroy
  8. router.post(target, `${profix}/${index}/${target}/update/:id`, controller[index][target].update);
  9. };