typedserver/ts/servertools/classes.handler.ts

18 lines
509 B
TypeScript
Raw Normal View History

2023-03-30 13:15:48 +00:00
import * as plugins from '../typedserver.plugins.js';
import { Request, Response } from 'express';
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;
}
}