UNPKG

micri

Version:

Asynchronous HTTP microservices

9 lines (8 loc) 540 B
/// <reference types="node" /> import { IncomingMessage, ServerResponse, Server } from 'http'; import { MicriHandler } from './types'; import { MicriError } from './errors'; export declare function send(res: ServerResponse, statusCode: number, obj?: any): void; export declare const sendError: (req: IncomingMessage, res: ServerResponse, errorObj: Error | MicriError) => void; export declare function run(req: IncomingMessage, res: ServerResponse, fn: MicriHandler): Promise<void>; export declare const serve: (fn: MicriHandler) => Server;