Feature

object Feature : ApplicationFeature<Application, Kweb.Feature.Configuration, Kweb>

If you have an existing Ktor server, you can use the Kweb class as a feature. Adding this to your code is easy:

    install(DefaultHeaders)
install(Compression)
install(WebSockets) {
pingPeriod = Duration.ofSeconds(10)
timeout = Duration.ofSeconds(30)
}

install(Kweb) {
// Set debug or plugins here, if you'd like
buildPage = {
// Your app goes here as it would using the Ktor constructor
}
}

See also

kweb.demos.feature.kwebFeature

for an example

Types

Configuration
Link copied to clipboard
class Configuration

Functions

install
Link copied to clipboard
open override fun install(pipeline: Application, configure: Kweb.Feature.Configuration.() -> Unit): Kweb

Properties

key
Link copied to clipboard
open override val key: AttributeKey<Kweb>