Module

Bucketchain.CORS

Package
purescript-bucketchain-cors
Repository
Bucketchain/purescript-bucketchain-cors

#AllowOrigins Source

data AllowOrigins

The type of Access-Control-Allow-Origin.

Constructors

#AllowCredentials Source

type AllowCredentials = Boolean

The type of Access-Control-Allow-Credentials.

#MaxAge Source

type MaxAge = Seconds

The type of Access-Control-Max-Age.

#AllowMethods Source

type AllowMethods = Array Method

The type of Access-Control-Allow-Methods.

#AllowHeaders Source

data AllowHeaders

The type of Access-Control-Allow-Headers.

Constructors

#ExposeHeaders Source

type ExposeHeaders = Array String

The type of Access-Control-Expose-Headers.

#Options Source

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

The type of CORS options.

#defaultOptions Source

defaultOptions :: Options

Default options.

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

#withCORS Source

withCORS :: Options -> Middleware

The CORS middleware.