Route.ts 522 B

1234567891011121314151617181920212223
  1. import { HttpMethod } from './HttpMethod';
  2. import { HttpHandler } from './HttpHandler';
  3. import { Request } from './Request';
  4. import { Response } from './Response';
  5. abstract class Route extends HttpHandler {
  6. protected abstract method: HttpMethod;
  7. protected abstract action: (req: Request, res: Response) => any;
  8. protected get documentation(): string {
  9. return '';
  10. }
  11. public getMethod(): HttpMethod {
  12. return this.method;
  13. }
  14. public getDocumentation(): string {
  15. return this.documentation;
  16. }
  17. }
  18. export { Route };