ktor-server-core / io.ktor.application / Application

Application

class Application : 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

<init>

Application(environment: ApplicationEnvironment)

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.

Properties

coroutineContext

val coroutineContext: <ERROR CLASS>

environment

val environment: ApplicationEnvironment

Instance of ApplicationEnvironment describing environment this application runs in

Inherited Properties

developmentMode

val developmentMode: Boolean

receivePipeline

val receivePipeline: ApplicationReceivePipeline

Pipeline for receiving content

sendPipeline

val sendPipeline: ApplicationSendPipeline

Pipeline for sending content

Functions

dispose

fun dispose(): Unit

Called by ApplicationEngine when Application is terminated

Extension Properties

conversionService

val ApplicationCallPipeline.conversionService: ConversionService

Lookup for a conversion service. Returns the default one if the feature wasn't installed

log

val Application.log: Logger

Convenience property to access log from application

Extension Functions

routing

fun Application.routing(configuration: Routing.() -> Unit): Routing

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

writeMultipleRanges

fun CoroutineScope.writeMultipleRanges(channelProducer: (LongRange) -> ByteReadChannel, ranges: List<LongRange>, fullLength: Long?, boundary: String, contentType: String): ByteReadChannel

Start multirange response writer coroutine