Routing

class Routing(application: Application) : Route

A root routing node of an Application. You can learn more about routing in Ktor from Routing.

Parameters

application

is an instance of Application for this routing node.

Constructors

Link copied to clipboard
fun Routing(application: Application)

Types

Link copied to clipboard
object Plugin : BaseApplicationPlugin<Application, Routing, Routing>

An installation object of the Routing plugin.

Functions

Link copied to clipboard
open fun afterIntercepted()
Link copied to clipboard
fun createChild(selector: RouteSelector): Route

Creates a child node in this node with a given selector or returns an existing one with the same selector.

Link copied to clipboard
fun handle(handler: <ERROR CLASS><Unit, ApplicationCall>)

Installs a handler into this route which is called when the route is selected for a call.

Link copied to clipboard
suspend fun interceptor(context: <ERROR CLASS><Unit, ApplicationCall>)
Link copied to clipboard
operator fun invoke(body: Route.() -> Unit)

Allows using a route instance for building additional routes.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun trace(block: (RoutingResolveTrace) -> Unit)

Registers a function used to trace route resolution. Might be useful if you need to understand why a route isn't executed. To learn more, see Tracing routes.

Properties

Link copied to clipboard
val application: Application
Link copied to clipboard
val children: List<Route>

List of child routes for this node.

Link copied to clipboard
val developmentMode: Boolean = false
Link copied to clipboard
open val environment: ApplicationEnvironment? = null
Link copied to clipboard
val parent: Route?
Link copied to clipboard
val receivePipeline: ApplicationReceivePipeline

Pipeline for receiving content

Link copied to clipboard
val selector: RouteSelector
Link copied to clipboard
val sendPipeline: ApplicationSendPipeline

Pipeline for sending content