Application

class Application(environment: ApplicationEnvironment) : ApplicationCallPipeline

Represents configured and running web application, capable of handling requests. It is also the application coroutine scope that is cancelled immediately at application stop so useful for launching background coroutines.

Parameters

environment

Instance of ApplicationEnvironment describing environment this application runs in

Constructors

Link copied to clipboard
fun Application(environment: ApplicationEnvironment)

Functions

Link copied to clipboard
fun dispose()

Called by ApplicationEngine when Application is terminated

Properties

Link copied to clipboard
open val coroutineContext: CoroutineContext
Link copied to clipboard
val developmentMode: Boolean = false
Link copied to clipboard
open override val environment: ApplicationEnvironment
Link copied to clipboard
val receivePipeline: ApplicationReceivePipeline

Pipeline for receiving content

Link copied to clipboard
val sendPipeline: ApplicationSendPipeline

Pipeline for sending content

Extensions

Link copied to clipboard
val Application.log: <ERROR CLASS>

Convenience property to access log from application

Link copied to clipboard
val Application.mdcProvider: MDCProvider

Returns first instance of a plugin that implements MDCProvider or default implementation with an empty context

Link copied to clipboard
fun Application.routing(configuration: Routing.() -> Unit): Routing

Gets or installs a Routing plugin for the this Application and runs a configuration script on it