WebServer

object WebServer

A utility object to manage a Ktor-based web server. This provides methods to start and stop the web server with custom configurations and routes.

The WebServer object encapsulates server setup, logging, exception handling, WebSockets, and more.

Functions

Link copied to clipboard
fun start(port: Int = 8080, host: String = "0.0.0.0", routeBlock: Application.() -> Unit)

Starts the web server with specified configurations.

Link copied to clipboard
fun stop()

Stops the web server if it is running.