Function corsOriginHandler

  • Parameters

    • origin: string
    • callback: ((error, origin) => void)
        • (error, origin): void
        • Parameters

          • error: Error
          • origin: string

          Returns void

    Returns void

    Description

    CORS origin validation handler. In non-debug environments, the origin must match the ALLOWED_ORIGIN config regexp (defaults to the package name without -server).

    Example

    import { corsOriginHandler } from '@biorate/nestjs-tools';

    app.enableCors({ origin: corsOriginHandler });