@micro.ts/core
Version:
Microservice framework with Typescript
26 lines (25 loc) • 951 B
TypeScript
import { DefinitionHandlerPair } from '../../AbstractBroker';
import { HttpBroker, HttpVerbs, IHttpListnerConfig } from '../HttpBroker';
import { Application, Request, Response } from 'express';
import { Action } from '../../../server/types';
export declare class ExpressBroker extends HttpBroker<Application, Request, Response, IHttpListnerConfig> {
name: string;
protected construct(): void;
protected server: Application;
protected requestMapper: (r: Request) => Promise<Action>;
protected paramWrapper(paramName: string): string;
/**
* Register single express handler
* @param value
* @param route
* @param method
*/
protected registerHandler(value: DefinitionHandlerPair[], route: string, method: HttpVerbs): void;
/**
* Respond to express request
* @param result
* @param ctx
*/
protected respond(result: Action, ctx: Response): any;
start(): Promise<void>;
}