UNPKG

@stuntman/server

Version:

Stuntman - HTTP proxy / mock server with API

28 lines 999 B
import http from 'http'; import { NextFunction, Request, Response, Express as ExpressServer } from 'express'; import type * as Stuntman from '@stuntman/shared'; import { LRUCache } from 'lru-cache'; type ApiOptions = Stuntman.ApiConfig & { mockUuid: string; }; export declare class API { protected options: Required<Exclude<ApiOptions, { disabled: true; } & { mockUuid: string; }>>; protected webGuiOptions: Stuntman.WebGuiConfig; protected apiApp: ExpressServer | null; trafficStore: LRUCache<string, Stuntman.LogEntry>; server: http.Server | null; constructor(options: ApiOptions, webGuiOptions?: Stuntman.WebGuiConfig); private auth; protected authReadOnly(req: Request, _res: Response, next: NextFunction): void; protected authReadWrite(req: Request, _res: Response, next: NextFunction): void; private initApi; private initWebGui; start(): void; stop(): Promise<void>; } export {}; //# sourceMappingURL=api.d.ts.map