Ktor 3.0.0 Help

Shutdown URL

The ShutDownUrl plugin allows you to configure a URL used to shut down the server. There are two ways to enable this plugin:

Configure shutdown URL in a configuration file

You can configure a shutdown URL in a configuration file using the ktor.deployment.shutdown.url property.

ktor { deployment { shutdown.url = "/shutdown" } }
ktor: deployment: shutdown: url: "/shutdown"

Configure shutdown URL by installing the plugin

To install and configure shutdown URL in code, pass ShutDownUrl.ApplicationCallPlugin to the install function and use the shutDownUrl property:

install(ShutDownUrl.ApplicationCallPlugin) { shutDownUrl = "/shutdown" exitCodeSupplier = { 0 } }

You can find the full example here: shutdown-url.

Last modified: 14 December 2022