LivePreviewEndpoint

class LivePreviewEndpoint(origin: File)

Handler of the live preview endpoint (/live/<file>) which serves static files relative to a target file or directory. Additionally, for HTML files, it serves a wrapper HTML that includes a WebSocket script + iframe for live previewing.

Parameters

origin

the root directory from which files are served

Constructors

Link copied to clipboard
constructor(origin: File)

Functions

Link copied to clipboard
suspend fun handleRequest(call: ApplicationCall, port: Int)

Handles a request to the live preview endpoint, by serving the requested file or a wrapper HTML for live preview.