Module

Bucketchain.CORS

#AllowOrigins

data AllowOrigins

The type of Access-Control-Allow-Origin.

Constructors

#AllowCredentials

type AllowCredentials = Boolean

The type of Access-Control-Allow-Credentials.

#MaxAge

type MaxAge = Seconds

The type of Access-Control-Max-Age.

#AllowMethods

type AllowMethods = Array Method

The type of Access-Control-Allow-Methods.

#AllowHeaders

data AllowHeaders

The type of Access-Control-Allow-Headers.

Constructors

#ExposeHeaders

type ExposeHeaders = Array String

The type of Access-Control-Expose-Headers.

#Options

type Options = { allowHeaders :: AllowHeaders, credentials :: AllowCredentials, exposeHeaders :: ExposeHeaders, maxAge :: MaxAge, methods :: AllowMethods, origins :: AllowOrigins }

The type of CORS options.

#defaultOptions

defaultOptions :: Options

Default options.

  • origins: AnyOrigin
  • credentials: false
  • maxAge: 1728000
  • methods: [ GET, HEAD, PUT, POST, DELETE, PATCH ]
  • allowHeaders: AnyHeader
  • exposeHeaders: []

#withCORS

withCORS :: Options -> Middleware

The CORS middleware.

Modules