Route
open class Route : ApplicationCallPipeline
Describes a node in a routing tree.
Parameters
parent
- is a parent node in the tree, or null for root node.
selector
- is an instance of RouteSelector for this node.
developmentMode
- is flag to switch report level for stack traces.
Constructors
Route(parent: Route?, selector: RouteSelector) Route( Describes a node in a routing tree. |
Properties
List of child routes for this node |
|
val parent: Route? is a parent node in the tree, or null for root node. |
|
val selector: RouteSelector is an instance of RouteSelector for this node. |
Inherited Properties
val developmentMode: Boolean Indicated if debug mode is enabled. In debug mode users will get more details in the stacktrace. |
|
val receivePipeline: ApplicationReceivePipeline Pipeline for receiving content |
|
val sendPipeline: ApplicationSendPipeline Pipeline for sending content |
Functions
open fun afterIntercepted(): Unit Invoked after an interceptor has been installed |
|
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 |
|
fun handle( Installs a handler into this route which will be called when the route is selected for a call |
|
Allows using route instance for building additional routes |
|
open fun toString(): String |
Extension Properties
val Route.application: Application Gets an Application for this Route by scanning the hierarchy to the root |
|
val ApplicationCallPipeline.conversionService: ConversionService Lookup for a conversion service. Returns the default one if the feature wasn’t installed |
|
Base package for relative resources calculations for static content |
|
Base folder for relative files calculations for static content |
Extension Functions
fun Route.accept( Builds a route to match requests with HttpHeaders.Accept header matching specified contentType |
|
fun Route.authenticate( Creates an authentication route that does handle authentication by the specified providers referred by
configurations names. |
|
fun Route.contentType( Builds a route to match requests with HttpHeaders.ContentType header matching specified contentType |
|
Create a routing entry for specified path |
|
Specifies localPath as a default file to serve when folder is requested |
|
Specifies resource as a default resources to serve when folder is requested |
|
fun <T : Any> Route.delete( Registers a typed handler body for a |
|
fun Route.delete( Builds a route to match fun Route.delete( Builds a route to match |
|
Executes this pipeline |
|
Sets up routing to serve localPath file as remotePath |
|
Sets up routing to serve all files from folder |
|
fun <T : Any> Route.get( Registers a typed handler body for a |
|
fun Route.get( Builds a route to match fun Route.get( Builds a route to match |
|
fun <T : Any> Route.handle( Registers a handler body for a location defined by class T. fun <T : Any> Route.handle( Registers a handler body for a location defined by class dataClass. |
|
fun <T : Any> Route.head( Registers a typed handler body for a |
|
fun Route.head( Builds a route to match fun Route.head( Builds a route to match |
|
Builds a route to match header with specified name and value |
|
fun Route.host( fun Route.host( Create a route to match request host and port. There are no any host resolutions/transformations applied to a host: a request host is treated as a string. |
|
fun <TSubject : Any, TContext : Any> Pipeline<*, TContext>.intercept( Intercepts an untyped pipeline when the subject is of the given type |
|
Create a route to match the port on which the call was received. |
|
Registers a route body for a location defined by class T. Registers a route body for a location defined by class data. |
|
fun Route.method( Builds a route to match specified method |
|
Builds a route to optionally capture parameter with specified name, if it exists |
|
fun <T : Any> Route.options( Registers a typed handler body for a |
|
fun Route.options( Builds a route to match fun Route.options( Builds a route to match |
|
Builds a route to match parameter with specified name and value Builds a route to match parameter with specified name and capture its value |
|
fun <T : Any> Route.patch( Registers a typed handler body for a |
|
fun Route.patch( Builds a route to match fun Route.patch( Builds a route to match |
|
Create a route to match request port. |
|
fun <T : Any> Route.post( Registers a typed handler body for a |
|
fun Route.post( Builds a route to match fun <R : Any> Route.post( Builds a route to match fun Route.post( Builds a route to match |
|
fun Route.preCompressed( Support pre-compressed files in the file system only (not just any classpath resource) |
|
fun <T : Any> Route.put( Registers a typed handler body for a |
|
fun Route.put( Builds a route to match fun Route.put( Builds a route to match |
|
fun Route.resource( Sets up routing to serve resource as remotePath in resourcePackage |
|
Sets up routing to serve all resources in resourcePackage |
|
Builds a route to match specified path |
|
Create a block for static content Create a block for static content at specified remotePath |
|
fun Route.webResources( Serve web resources (usually a directory named webapp containing WEB-INF/web.xml). Note that WEB-INF directory itself is not served by default. |
|
fun Route.webSocket( Bind websocket at the current route optionally checking for websocket protocol (ignored if fun Route. Bind websocket at the current route optionally checking for websocket protocol (ignored if fun Route.webSocket( Bind websocket at the current route + path optionally checking for websocket protocol (ignored if |
|
fun Route.webSocketRaw( fun Route.webSocketRaw( Bind RAW websocket at the current route + path optionally checking for websocket protocol (ignored if fun Route.webSocketRaw( fun Route.webSocketRaw( Bind RAW websocket at the current route optionally checking for websocket protocol (ignored if fun Route. Bind RAW websocket at the current route optionally checking for websocket protocol (ignored if |
Inheritors
class Routing : Route Root routing node for an Application |