start

fun start(options: WebServerOptions, session: ServerMessageSession, onServerStarted: (Stoppable) -> Unit = {}, onSessionReady: suspend () -> Unit = { })

Starts the web server which serves the specified file and allows for live reloading.

Parameters

options

options to start the server with

session

session to use to communicate with the web server

onServerStarted

callback invoked once the server is bound and ready, with the handle that can later stop it. Callers should hold on to this handle to distinguish "server is running" from "session is open" across reload cycles.

onSessionReady

optional callback to invoke when the session is ready