Route.ts 491 B

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