nralcm
Version:
This is a framework based on NodeJs to manage rest api request lifecycle
28 lines (27 loc) • 857 B
TypeScript
import { IHttpHandler } from "../http-handler";
import { RestApiConfiguration } from ".";
/**
* HttpConfiguration class provides methods to configure application
*/
export declare class HttpConfiguration {
private restApiConfiguration;
constructor(restApiConfiguration: RestApiConfiguration);
private handlers;
/**
* Method to add handler
* @param url string or regex
* @param handler IHttpHandler
*/
addHandler(url: string, handler: IHttpHandler): void;
/**
* Method to get handler
* @param url string or regex
*/
getHandler(url: string): [string, IHttpHandler] | undefined;
/**
* Removes registered handler
* @param insatanceOfHandler class instance that implemented IHttpHandler
* @returns boolean
*/
removeHandler(insatanceOfHandler: IHttpHandler): boolean;
}