ServerApplication

abstract class ServerApplication : KoinComponent

ServerApplication class provides quick extensions for configuring Ktor Server at startup.

Example usage:

class MyApplication : ServerApplication() {

override val configurers = listOf(Routing, Security)

override fun launch() {
val environment = createApplicationEngineEnvironment()

embeddedServer(Netty, environment).start(wait = true)
}
}

See also

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
val config: ApplicationConfig
Link copied to clipboard
abstract val configurers: Configurers
Link copied to clipboard
val koinModule: Module

Functions

Link copied to clipboard
fun Application.applyApplicationConfigurersAndRoutes(koinModule: Module = this@ServerApplication.koinModule, config: ApplicationConfig = environment.config)
Link copied to clipboard
fun ApplicationEngineEnvironmentBuilder.applyEnvironmentConfiguration(koinModule: Module = this@ServerApplication.koinModule, config: ApplicationConfig = this@ServerApplication.config)
Link copied to clipboard
fun createApplicationEngineEnvironment(koinModule: Module = this.koinModule, config: ApplicationConfig = this.config): ApplicationEngineEnvironment
Link copied to clipboard
open fun getKoin(): Koin
Link copied to clipboard
abstract fun launch()