router.js 505 B

1234567891011121314151617
  1. 'use strict';
  2. /**
  3. * @param {Egg.Application} app - egg application
  4. */
  5. module.exports = app => {
  6. const { router, controller } = app;
  7. // 上传
  8. router.post('/:appid/upload', controller.home.upload);
  9. router.post('/:appid/:catalog/upload', controller.home.upload);
  10. router.post('/:appid/:catalog/:item/upload', controller.home.upload);
  11. router.get(/^\/api*/, controller.home.request);
  12. router.post(/^\/api*/, controller.home.request);
  13. router.delete(/^\/api*/, controller.home.request);
  14. };