@bestcodetools/api-node-base
Version:
BestCodeTools Node Base for Backend API
23 lines • 927 B
TypeScript
import express, { NextFunction } from 'express';
import { ICommand } from "../../../@types/interfaces";
import IHttpHandler from "../../../@types/interfaces/http/handler";
export default class HttpHandler implements IHttpHandler {
protected request: express.Request;
protected response: express.Response;
protected next: NextFunction;
protected command: ICommand<any, any>;
constructor(request: express.Request, response: express.Response, next: NextFunction, command: ICommand<any, any>);
private setupHandlers;
protected send(statusCode: number, body: any, headers?: any): void;
private onBadRequest;
private onUnprocessableEntity;
private onUnauthorized;
private onForbidden;
private onInternalError;
private onNotImplemented;
private onSuccess;
private onCreated;
protected buildInput(): any;
handle(): Promise<void>;
}
//# sourceMappingURL=index.d.ts.map