OPTIONS

fun OPTIONS(pattern: String, f: suspend (ServerRequest) -> ServerResponse)

Adds a route to the given handler function that handles all HTTP OPTIONS requests that match the given pattern.

Parameters

pattern

the pattern to match to


fun OPTIONS(pattern: String, predicate: RequestPredicate, f: suspend (ServerRequest) -> ServerResponse)

Adds a route to the given handler function that handles all HTTP OPTIONS requests that match the given pattern.

Since

5.2

Parameters

pattern

the pattern to match to

predicate

additional predicate to match


Return a RequestPredicate that matches if request's HTTP method is OPTIONS and the given pattern matches against the request path.

Return

a predicate that matches if the request method is OPTIONS and if the given pattern matches against the request path

Parameters

pattern

the path pattern to match against