AbstractEndpoint

open class AbstractEndpoint(paths: List<String> = listOf("/"))

Represents an endpoint to use to implement routing in an object-orientated way.

Parameters

paths

A list of HTTP resources that will be subsequently merged within the routing plugin.

Constructors

Link copied to clipboard
constructor(vararg paths: String)

Register endpoints with multiple resources that it'll be located at.

constructor(path: String)

Represents an endpoint to use to implement routing in an object-orientated way.

constructor(paths: List<String> = listOf("/"))

Functions

Link copied to clipboard
fun <C : Any, B : Any> install(plugin: Plugin<Route, C, B>, configure: C.() -> Unit = {}): AbstractEndpoint

Installs a route plugin into every route that is installed on this AbstractEndpoint.

fun <C : Any, B : Any> install(method: HttpMethod, plugin: Plugin<Route, C, B>, configure: C.() -> Unit = {}): AbstractEndpoint

Installs a Route plugin with the specified HttpMethod.

fun <C : Any, B : Any> install(route: String, plugin: Plugin<Route, C, B>, configure: C.() -> Unit = {}): AbstractEndpoint

Installs a route plugin on a specific route that is installed on this AbstractEndpoint.

fun <C : Any, B : Any> install(routes: List<String>, plugin: Plugin<Route, C, B>, configure: C.() -> Unit = {}): AbstractEndpoint

Installs a route plugin into every route listed in the routes list with the methods that are registered with it.

fun <C : Any, B : Any> install(endpoints: Map<HttpMethod, String>, plugin: Plugin<Route, C, B>, configure: C.() -> Unit = {}): AbstractEndpoint

Installs a route plugin into every route listed in the endpoints map with a mapping of method -> route.

fun <C : Any, B : Any> install(method: HttpMethod, route: String, plugin: Plugin<Route, C, B>, configure: C.() -> Unit = {}): AbstractEndpoint

Installs a route plugin on a specific route AND method that is installed on this AbstractEndpoint.