Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CORSMiddleware

CORSMiddleware is used to enable CORS on APIs. It will automatically add the necessary headers necessary to communicate with CORS enabled clients.

Hierarchy

Index

Constructors

constructor

  • new CORSMiddleware(allowedOrigin?: string, allowedHeaders?: Array<string>, allowedMethods?: Array<string>): CORSMiddleware
  • Parameters

    • Optional allowedOrigin: string

      The allowed origin. By default it will use the request origin.

    • Optional allowedHeaders: Array<string>

      Array of allowed headers.

    • Optional allowedMethods: Array<string>

      Array of allowed HTTP methods.

    Returns CORSMiddleware

Methods

Protected _execute

execute

getDefaultAllowedHeaders

  • getDefaultAllowedHeaders(): Array<string>

getDefaultAllowedMethods

  • getDefaultAllowedMethods(): Array<string>

getDefaultAllowedOrigin

  • getDefaultAllowedOrigin(): string

Generated using TypeDoc