AdminSystem.js 593 B

123456789101112131415161718192021222324252627282930313233343536
  1. const express = require('express');
  2. const router = express.Router();
  3. var path = require('path');
  4. const RoutingSystem = require('./RoutingSystem');
  5. let mainroutes = [
  6. {
  7. type: 'file',
  8. method: 'get',
  9. endpoint: '/',
  10. file: '/index.html'
  11. },
  12. {
  13. type: 'custom',
  14. method: 'get',
  15. endpoint: '/test',
  16. customFn: (req, res) => {
  17. res.send("ASDSADSDA");
  18. }
  19. },
  20. ];
  21. class AdminSystem {
  22. constructor() {
  23. this.router = router;
  24. this.createSetupRoutes();
  25. }
  26. createSetupRoutes() {
  27. RoutingSystem.loadRoutes(mainroutes, this.router, '/admin');
  28. }
  29. }
  30. module.exports = new AdminSystem();