KovenServerBuilder

A builder context for configuring routes and server settings.

Constructors

Link copied to clipboard
constructor(config: KovenServerConfig)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun add(route: RoutingHttpHandler)

Adds a RoutingHttpHandler to the server.

Link copied to clipboard
inline fun <Req, Res, ReqH, ResH, PathP, QueryP, CookieP> ApiContract<Req, Res, ReqH, ResH, PathP, QueryP, CookieP>.handle(filter: Filter = Filter.NoOp, crossinline handler: context(Request, Raise<Issue>, ReqH, CookieP, Principal) ApiContract<Req, Res, ReqH, ResH, PathP, QueryP, CookieP>.(Req, PathP, QueryP) -> ApiResponse<Res, ResH>)

Adds an ApiContract to the server by registering a route with the given handler.

inline fun <Req, Res, ReqH, ResH, CookieP> ApiContract<Req, Res, ReqH, ResH, Empty, Empty, CookieP>.handle(filter: Filter = Filter.NoOp, crossinline handler: context(Request, Raise<Issue>, ReqH, CookieP, Principal) ApiContract<Req, Res, ReqH, ResH, Empty, Empty, CookieP>.(Req) -> ApiResponse<Res, ResH>)

Adds an ApiContract, with no query or path parameters, to the server by registering a route with the given handler.

@JvmName(name = "handleUnit")
inline fun <Req, ReqH, PathP, QueryP, CookieP> ApiContract<Req, Unit, ReqH, Empty, PathP, QueryP, CookieP>.handle(filter: Filter = Filter.NoOp, crossinline handler: context(Request, Raise<Issue>, ReqH, CookieP, Principal) ApiContract<Req, Unit, ReqH, Empty, PathP, QueryP, CookieP>.(Req, PathP, QueryP) -> Unit)

Adds an ApiContract, with no response body or headers, to the server by registering a route with the given handler.

@JvmName(name = "handleSimpleUnit")
inline fun <Req, ReqH, CookieP> ApiContract<Req, Unit, ReqH, Empty, Empty, Empty, CookieP>.handle(filter: Filter = Filter.NoOp, crossinline handler: context(Request, Raise<Issue>, ReqH, CookieP, Principal) ApiContract<Req, Unit, ReqH, Empty, Empty, Empty, CookieP>.(Req) -> Unit)

Adds an ApiContract, with no response body, response headers, query parameters or path parameters, to the server by registering a route with the given handler.

Link copied to clipboard
inline fun <Res, ReqH, ResH, PathP, QueryP, CookieP> ApiContract<Multipart, Res, ReqH, ResH, PathP, QueryP, CookieP>.handleMultipart(filter: Filter = Filter.NoOp, crossinline handler: context(Request, Raise<Issue>, ReqH, CookieP, Principal) ApiContract<Multipart, Res, ReqH, ResH, PathP, QueryP, CookieP>.(Multipart, PathP, QueryP) -> ApiResponse<Res, ResH>)

Adds an ApiContract with a multipart request body to the server.

Link copied to clipboard
inline fun <Req, T, ReqH, ResH, PathP, QueryP, CookieP> ApiContract<Req, PaginatedResponse<T>, ReqH, ResH, PathP, QueryP, CookieP>.handlePaginated(filter: Filter = Filter.NoOp, crossinline handler: context(Request, Raise<Issue>, ReqH, CookieP, Principal) ApiContract<Req, PaginatedResponse<T>, ReqH, ResH, PathP, QueryP, CookieP>.(Req, PathP, QueryP, Pagination) -> ApiResponse<List<T>, ResH>)

Adds a paginated ApiContract to the server.