micri
Version:
Asynchronous HTTP microservices
16 lines (15 loc) • 501 B
TypeScript
import { IncomingMessage, ServerResponse } from 'http';
export interface WorkerResponseHeader {
statusCode: number;
statusMessage?: string;
headers: {
[index: string]: string | string[] | undefined;
};
}
export default function withWorker<OptsType = any>(handlerPath: string, workerOpts?: {
eval?: boolean;
limit?: string;
env?: {
[index: string]: string | undefined;
};
}): (req: IncomingMessage, res: ServerResponse, opts: OptsType) => Promise<void>;