nest-koa-adapter
Version:
Koa HTTP adapter for Nest.js
19 lines • 840 B
TypeScript
import Koa, { Context } from 'koa';
import KoaRouter from 'koa-router';
import { Options } from '@koa/cors';
import { CorsOptions } from '@nestjs/common/interfaces/external/cors-options.interface';
type OriginResolver = (ctx: Context) => string;
export declare class KoaCorsOptions implements Options {
readonly allowHeaders?: string[] | string;
readonly allowMethods?: string[] | string;
readonly credentials?: boolean;
readonly exposeHeaders?: string[] | string;
readonly maxAge?: number | string;
readonly origin?: OriginResolver;
static validateNestOptions(options?: CorsOptions): void;
constructor(nestOptions: CorsOptions);
private createOriginResolver;
handleOptionsSuccessStatus(koa: Koa | KoaRouter, nestOptions?: CorsOptions): void;
}
export {};
//# sourceMappingURL=KoaCorsOptions.d.ts.map