example.js 1.2 KB

12345678910111213141516171819202122232425262728293031
  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. // open launch
  10. router.post('/api/example/autoLaunchEnable', controller.example.autoLaunchEnable);
  11. // close launch
  12. router.post('/api/example/autoLaunchDisable', controller.example.autoLaunchDisable);
  13. // is launch
  14. router.post('/api/example/autoLaunchIsEnabled', controller.example.autoLaunchIsEnabled);
  15. // open software
  16. router.post('/api/example/openSoftware', controller.example.openSoftware);
  17. // test some electron api
  18. router.post('/api/example/testElectronApi', controller.example.testElectronApi);
  19. // test2
  20. router.post('/api/example/test2', controller.example.test2);
  21. // message show
  22. router.post('/api/example/messageShow', controller.example.messageShow);
  23. // message show confirm
  24. router.post('/api/example/messageShowConfirm', controller.example.messageShowConfirm);
  25. // upload chrome extension
  26. router.post('/api/example/uploadExtension', controller.example.uploadExtension);
  27. // db operation
  28. router.post('/api/example/dbOperation', controller.example.dbOperation);
  29. };