@amadeus-it-group/kassette
Version:
Development server, used mainly for testing, which proxies requests and is able to easily manage local mocks.
28 lines (27 loc) • 1.18 kB
TypeScript
import { Server } from 'net';
import { IMergedConfiguration } from '../configuration';
import { APIOptions, ApplicationData, CLIOptions } from './model';
export * from './configuration';
export * from './requesting';
/** A wrapper around a Node.js request (`IncomingMessage`) */
export * from './request';
/** A wrapper around a Node.js response (`ServerResponse`) */
export * from './response';
/** A wrapper around a Node.js response from a server (`IncomingMessage`) */
export * from './server-response';
/** Spawns the server */
export declare function spawnServer({ configuration, root }: ApplicationData): Promise<Server>;
export declare function _run(configuration: IMergedConfiguration | null): Promise<() => void>;
/**
* Launch the proxy programmatically.
*
* @param options - kassette configuration options
* @returns a callback that can be used to shutdown the proxy, calling the {@link ConfigurationSpec.onExit|onExit} callback defined in configuration (if provided).
*
* @public
*/
export declare function runFromAPI(options: APIOptions): Promise<() => void>;
/**
* @internal
*/
export declare function runFromCLI(options: CLIOptions): Promise<() => void>;