Routing
A root routing node of an Application. You can learn more about routing in Ktor from Routing.
Parameters
is an instance of Application for this routing node.
Constructors
Types
An installation object of the Routing plugin.
Functions
Creates a child node in this node with a given selector or returns an existing one with the same selector.
Installs a handler into this route which is called when the route is selected for a call.
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
Extensions
Builds a route to match requests with the HttpHeaders.Accept header matching any of the specified contentTypes.
Gets an Application for this Route by scanning the hierarchy to the root.
Builds a route to match requests with the HttpHeaders.ContentType header matching the specified contentType.
Creates a routing entry for the specified path.
Specifies resource as a default resources to serve when folder is requested
Builds a route to match DELETE
requests with the specified regex path. Named parameters from regex can be accessed via ApplicationCall.parameters.
Builds a route to match DELETE
requests with the specified path.
Builds a route to match DELETE
requests.
Builds a route to match GET
requests with the specified regex path. Named parameters from regex can be accessed via ApplicationCall.parameters.
Builds a route to match GET
requests with the specified path.
Builds a route to match GET
requests.
Return list of endpoints with handlers under this route.
Builds a route to match HEAD
requests with the specified regex path. Named parameters from regex can be accessed via ApplicationCall.parameters.
Builds a route to match HEAD
requests with the specified path.
Builds a route to match HEAD
requests.
Creates a route to match a request's host and port. There are no any host resolutions/transformations applied to a host: a request host is treated as a string.
Creates a route to match a request host and port. There are no any host resolutions/transformations applied to a host: a request host is treated as a string.
Creates a route to match s request host and port. There are no any host resolutions/transformations applied to a host: a request host is treated as a string.
Builds a route to match OPTIONS
requests with the specified regex path. Named parameters from regex can be accessed via ApplicationCall.parameters.
Builds a route to match OPTIONS
requests with the specified path.
Builds a route to match OPTIONS
requests.
Builds a route to match PATCH
requests with the specified regex path. Named parameters from regex can be accessed via ApplicationCall.parameters.
Builds a route to match PATCH
requests with the specified regex path receiving a request body as content of the R type. Named parameters from regex can be accessed via ApplicationCall.parameters.
Builds a route to match PATCH
requests with the specified path.
Builds a route to match PATCH
requests.
Builds a route to match PATCH
requests receiving a request body as content of the R type.
Builds a route to match POST
requests with the specified regex path. Named parameters from regex can be accessed via ApplicationCall.parameters.
Builds a route to match POST
requests with the specified regex path receiving a request body as content of the R type. Named parameters from regex can be accessed via ApplicationCall.parameters.
Builds a route to match POST
requests with the specified path.
Builds a route to match POST
requests receiving a request body as content of the R type.
Builds a route to match POST
requests with the specified path receiving a request body as content of the R type.
Builds a route to match POST
requests.
Support pre-compressed files and resources
Builds a route to match PUT
requests with the specified regex path. Named parameters from regex can be accessed via ApplicationCall.parameters.
Builds a route to match PUT
requests with the specified regex path receiving a request body as content of the R type. Named parameters from regex can be accessed via ApplicationCall.parameters.
Builds a route to match PUT
requests with the specified path.
Builds a route to match PUT
requests.
Builds a route to match PUT
requests receiving a request body as content of the R type.
Sets up routing to serve resource as remotePath in resourcePackage
Sets up routing to serve all resources in resourcePackage
Builds a route to match the specified regex path. Named parameters from regex can be accessed via ApplicationCall.parameters.
Builds a route to match the specified HTTP method and regex path. Named parameters from regex can be accessed via ApplicationCall.parameters.
Builds a route to match the specified path.
Serves a single-page application. You can learn more from Serving single-page applications.
Base package for relative resources calculations for static content
Sets up Routing to serve static files. All files inside dir will be accessible recursively at "remotePath/path/to/file". If the requested file is a directory and index is not null
, then response will be index file in the requested directory.
Sets up Routing to serve resources as static content. All resources inside basePackage will be accessible recursively at "remotePath/path/to/resource". If requested resource doesn't exist and index is not null
, then response will be index resource in the requested package.
Base folder for relative files calculations for static content