Application

class Application(environment: ApplicationEnvironment) : ApplicationCallPipeline, CoroutineScope

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 addPhase(phase: PipelinePhase)
Link copied to clipboard
open fun afterIntercepted()
Link copied to clipboard
fun dispose()

Called by ApplicationEngine when Application is terminated

Link copied to clipboard
suspend fun execute(context: ApplicationCall, subject: Unit)
Link copied to clipboard
fun insertPhaseAfter(reference: PipelinePhase, phase: PipelinePhase)
Link copied to clipboard
fun insertPhaseBefore(reference: PipelinePhase, phase: PipelinePhase)
Link copied to clipboard
fun intercept(phase: PipelinePhase, block: suspend PipelineContext<Unit, ApplicationCall>.(Unit) -> Unit)
Link copied to clipboard
fun merge(from: Pipeline<Unit, ApplicationCall>)

Properties

Link copied to clipboard
val attributes: Attributes
Link copied to clipboard
open override val coroutineContext: CoroutineContext
Link copied to clipboard
override val developmentMode: Boolean = false
Link copied to clipboard
val environment: ApplicationEnvironment
Link copied to clipboard
val isEmpty: Boolean
Link copied to clipboard
val items: List<PipelinePhase>
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: Logger

Convenience property to access log from application

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

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