CorsMiddleware

io.github.edadma.apion.CorsMiddleware

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

case class Options(origin: Origin, methods: Set[String], allowedHeaders: Set[String], exposedHeaders: Set[String], credentials: Boolean, maxAge: Option[Int], preflightSuccessStatus: Int, optionsSuccessStatus: Int)

Configuration options for CORS middleware

Configuration options for CORS middleware

Value parameters

allowedHeaders

Allowed request headers

credentials

Allow credentials (cookies, authorization headers)

exposedHeaders

Headers exposed to the client

maxAge

How long preflight results can be cached (seconds)

methods

Allowed HTTP methods

optionsSuccessStatus

Status code for successful OPTIONS requests

origin

Origin configuration - can be "*", a string, or a list of allowed origins

preflightSuccessStatus

Status code for successful preflight requests

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Origin

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Origin.type
sealed trait Origin

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Any
class Function
class Multiple
class Pattern
class Single

Value members

Concrete methods

def apply(options: Options): Handler

Create CORS middleware with default options

Create CORS middleware with default options

Attributes

Preset for development with permissive settings

Preset for development with permissive settings

Attributes

def production(allowedOrigins: Set[String]): Handler

Preset for production with strict settings

Preset for production with strict settings

Attributes