Ktor 3.0.2 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 } }

For the full example, see shutdown-url.

Last modified: 30 April 2024