api.ts 490 B

12345678910111213
  1. // 共用模块
  2. module.exports = app => {
  3. const { router, controller } = app;
  4. const ApiRouter = router.namespace('/api');
  5. ApiRouter.get('/version', controller.api.apiController.version);
  6. ApiRouter.post('/user/register', controller.api.userController.register);
  7. };
  8. // module.exports = app => {
  9. // const { router, controller } = app;
  10. // const ApiRouter = router.namespace('/api', app.middleware.Auth);
  11. // const UserApiRouter = ApiRouter.namespace('/user');
  12. // };