@glandjs/http
Version:
A protocol adapter for HTTP built on top of the Gland architecture solution.
19 lines (18 loc) • 637 B
TypeScript
import type { RequestMethod } from '../enum';
import type { CustomOrigin, StaticOrigin } from '../types';
export interface CorsOptionsCallback {
(error: Error | null, options: CorsOptions): void;
}
export interface CorsOptionsDelegate<T> {
(req: T, cb: CorsOptionsCallback): void;
}
export interface CorsOptions {
origin?: StaticOrigin | CustomOrigin;
methods?: keyof typeof RequestMethod | (keyof typeof RequestMethod)[];
allowedHeaders?: string | string[];
exposedHeaders?: string | string[];
credentials?: boolean;
maxAge?: number;
preflightContinue?: boolean;
optionsSuccessStatus?: number;
}