LocalFileWebServer

class LocalFileWebServer(targetFile: File) : Server

Web server that:

  • Serves local file at targetFile;

  • Supports live preview of HTML files at /live/{file...} (LivePreviewEndpoint);

  • Supports live reloading at /reload (ReloadEndpoint): GET opens a Server-Sent Events stream for subscribers (browser clients), POST broadcasts a reload event to every active subscriber (Quarkdown CLI).

Parameters

targetFile

file to serve

Constructors

Link copied to clipboard
constructor(targetFile: File)

Functions

Link copied to clipboard
open override fun start(port: Int, wait: Boolean = false, onReady: (Stoppable) -> Unit = {})

Starts the server on port.

Link copied to clipboard