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.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
override val developmentMode: Boolean = false
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Convenience property to access log from application

Link copied to clipboard

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

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Pipeline for receiving content

Link copied to clipboard
Link copied to clipboard

Pipeline for sending content

Functions

Link copied to clipboard
Link copied to clipboard
open fun afterIntercepted()
Link copied to clipboard
fun dispose()

Called by ApplicationEngine when Application is terminated.

Link copied to clipboard
fun <TEngine : ApplicationEngine, TConfiguration : ApplicationEngine.Configuration> CoroutineScope.embeddedServer(factory: ApplicationEngineFactory<TEngine, TConfiguration>, vararg connectors: EngineConnectorConfig = arrayOf(), watchPaths: List<String> = listOf(WORKING_DIRECTORY_PATH), parentCoroutineContext: CoroutineContext = EmptyCoroutineContext, module: Application.() -> Unit): EmbeddedServer<TEngine, TConfiguration>

Creates an embedded server with the given factory, listening on given connectors.

fun <TEngine : ApplicationEngine, TConfiguration : ApplicationEngine.Configuration> CoroutineScope.embeddedServer(factory: ApplicationEngineFactory<TEngine, TConfiguration>, port: Int = 80, host: String = "0.0.0.0", watchPaths: List<String> = listOf(WORKING_DIRECTORY_PATH), parentCoroutineContext: CoroutineContext = EmptyCoroutineContext, module: Application.() -> Unit): EmbeddedServer<TEngine, TConfiguration>

Creates an embedded server with the given factory, listening on host:port.

Link copied to clipboard
suspend fun execute(context: PipelineCall, subject: Unit)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun intercept(phase: PipelinePhase, block: suspend PipelineContext<Unit, PipelineCall>.(Unit) -> Unit)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun Application.routing(configuration: RootRouting.() -> Unit): RoutingRoot

Installs a RoutingRoot plugin for the this Application and runs a configuration script on it. You can learn more about routing in Ktor from Routing.

Link copied to clipboard
open override fun toString(): String