/[sudobot]/trunk/src/api/Server.ts
ViewVC logotype

Diff of /trunk/src/api/Server.ts

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 347 by rakin, Mon Jul 29 17:29:42 2024 UTC revision 348 by rakin, Mon Jul 29 17:29:43 2024 UTC
# Line 33  export default class Server extends Serv Line 33  export default class Server extends Serv
33              message: { code: 429, error: 'Too many requests at a time. Please try again later.' },              message: { code: 429, error: 'Too many requests at a time. Please try again later.' },
34          }));          }));
35    
36            expressRouter.use(express.json());
37            expressRouter.use(express.urlencoded({ extended: true }));
38    
39          await this.router.loadRoutes();          await this.router.loadRoutes();
40    
41          for (const route of this.router.routes) {          for (const route of this.router.routes) {            
42              expressRouter[route.method.toLowerCase() as methods](route.path, ...route.middlewareList, await route.getCallbackFunction());              console.log(route.callback[1], route.callback[0].middleware()[route.callback[1]]);            
43                expressRouter[route.method.toLowerCase() as methods](route.path, ...(route.callback[0].middleware()[route.callback[1]] as any[] ?? []), ...route.middlewareList as any[], await route.getCallbackFunction());
44          }          }
45    
46          this.express.use(expressRouter);          this.express.use(expressRouter);

Legend:
Removed from v.347  
changed lines
  Added in v.348

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26