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

Annotation of /trunk/src/api/Controller.ts

Parent Directory Parent Directory | Revision Log Revision Log


Revision 349 - (hide annotations)
Mon Jul 29 17:29:43 2024 UTC (8 months, 1 week ago) by rakin
File MIME type: application/typescript
File size: 583 byte(s)
feat(api): auth middleware
1 rakin 349 import DiscordClient from "../client/Client";
2 rakin 325 import KeyValuePair from "../types/KeyValuePair";
3     import Response from "./Response";
4    
5 rakin 323 export default class Controller {
6 rakin 349 constructor(protected client: DiscordClient) {
7 rakin 348 console.log("Constructor call");
8     }
9    
10 rakin 349 protected response(body: string | object | null | undefined, status: number = 200, headers: KeyValuePair<string> = {}) {
11 rakin 325 return new Response(status, body, headers);
12     }
13 rakin 348
14     globalMiddleware(): Function[] {
15     return [];
16     }
17    
18     middleware(): KeyValuePair<Function[]> {
19     return {};
20     }
21 rakin 323 }

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26