@whatwg-node/router
Version:
Fetch API compliant HTTP Router
10 lines (9 loc) • 517 B
TypeScript
import { type DefaultServerAdapterContext } from '@whatwg-node/server';
import type { Router, RouterBaseObject } from './types';
interface RouterOptions<TServerContext = DefaultServerAdapterContext> {
base?: string;
RequestCtor?: typeof Request;
plugins?: Array<(router: RouterBaseObject<TServerContext>) => RouterBaseObject<TServerContext>>;
}
export declare function createRouter<TServerContext = DefaultServerAdapterContext>(options?: RouterOptions<TServerContext>): Router<TServerContext>;
export {};