example.js 734 B

123456789101112131415161718192021
  1. 'use strict';
  2. /**
  3. * @param {Egg.Application} app - egg application
  4. */
  5. module.exports = app => {
  6. const { router, controller } = app;
  7. // upload file
  8. router.post('/api/example/uploadFile', controller.example.uploadFile);
  9. // test some electron api
  10. router.post('/api/example/test1', controller.example.test1);
  11. // message show
  12. router.post('/api/example/messageShow', controller.example.messageShow);
  13. // message show confirm
  14. router.post('/api/example/messageShowConfirm', controller.example.messageShowConfirm);
  15. // upload chrome extension
  16. router.post('/api/example/uploadExtension', controller.example.uploadExtension);
  17. // db operation
  18. router.post('/api/example/dbOperation', controller.example.dbOperation);
  19. };