location

inline fun <T : Any> Route.location(noinline body: Route.() -> Unit): Route

Registers a route body for a location defined by class T.

Class Tmust be annotated with Location.


fun <T : Any> Route.location(data: KClass<T>, body: Route.() -> Unit): Route

Registers a route body for a location defined by class data.

Class datamust be annotated with Location.


inline fun <T : Any> ApplicationCall.location(): T

Retrieves the current call's location or fails if it is not available (request is not handled by a location class), or not yet available (invoked too early before the locations feature takes place).