2 |
import Response from "./Response"; |
import Response from "./Response"; |
3 |
|
|
4 |
export default class Controller { |
export default class Controller { |
5 |
|
constructor() { |
6 |
|
console.log("Constructor call"); |
7 |
|
} |
8 |
|
|
9 |
protected response(body: string, status: number = 200, headers: KeyValuePair<string> = {}) { |
protected response(body: string, status: number = 200, headers: KeyValuePair<string> = {}) { |
10 |
return new Response(status, body, headers); |
return new Response(status, body, headers); |
11 |
} |
} |
12 |
|
|
13 |
|
globalMiddleware(): Function[] { |
14 |
|
return []; |
15 |
|
} |
16 |
|
|
17 |
|
middleware(): KeyValuePair<Function[]> { |
18 |
|
return {}; |
19 |
|
} |
20 |
} |
} |