SsrEngine

class SsrEngine(nodeExecutable: String? = null, port: Int? = null, externalSsrService: String? = null, rpcUrlPrefix: String? = null, rootId: String? = null, contextPath: String? = null, noCache: Boolean = false)

Server-Side Rendering engine for Kilua.

Parameters

nodeExecutable

a path to the Node.js executable. If not provided, the default node command will be used.

port

a port for the SSR service. If not provided, the default port 7788 will be used.

externalSsrService

an external SSR service URL. If provided, the local SSR service will not be started.

rpcUrlPrefix

a prefix for the Kilua RPC fullstack services.

rootId

an ID of the root element in the HTML template.

contextPath

a context path for the application.

noCache

a flag to disable caching of SSR content.

Constructors

Link copied to clipboard
constructor(nodeExecutable: String? = null, port: Int? = null, externalSsrService: String? = null, rpcUrlPrefix: String? = null, rootId: String? = null, contextPath: String? = null, noCache: Boolean = false)

Functions

Link copied to clipboard
suspend fun getCssContent(): String

Get CSS stylesheet content for SSR.

Link copied to clipboard
suspend fun getRootContent(uri: String, locale: String? = null): String

Get root content for SSR.

Link copied to clipboard
suspend fun getSsrContent(uri: String, locale: String? = null): String

Get SSR content for the given URI and locale.