2023-03-30 13:15:48 +00:00
|
|
|
import * as plugins from '../typedserver.plugins.js';
|
2023-07-01 15:23:49 +00:00
|
|
|
import { type Request, type Response } from 'express';
|
2023-03-30 13:15:48 +00:00
|
|
|
|
|
|
|
export interface IHandlerFunction {
|
|
|
|
(requestArg: Request, responseArg: Response): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type THttpMethods = 'ALL' | 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
|
|
|
|
|
|
export class Handler {
|
|
|
|
httpMethod: THttpMethods;
|
|
|
|
handlerFunction: IHandlerFunction;
|
|
|
|
constructor(httpMethodArg: THttpMethods, handlerArg: IHandlerFunction) {
|
|
|
|
this.httpMethod = httpMethodArg;
|
|
|
|
this.handlerFunction = handlerArg;
|
|
|
|
}
|
|
|
|
}
|