router.js 406 B

12345678910111213
  1. 'use strict';
  2. /**
  3. * @param {Egg.Application} app - egg application
  4. */
  5. module.exports = app => {
  6. const { router, controller } = app;
  7. const { routePrefix, cluster } = app.config;
  8. router.get('/', controller.home.index);
  9. console.log(`${routePrefix}/sendEmail`);
  10. router.post(`${routePrefix}/sendEmail`, controller.email.sendEmail);
  11. router.post(`${routePrefix}/error`, controller.email.error);
  12. };