ServerSSRRenderer

class ServerSSRRenderer(body: BODY, handler: ElideController, request: HttpRequest<*>, script: ExecutableScript, buffer: StringBuilder = StringBuilder(), job: AtomicReference<Job?> = AtomicReference(null)) : SuspensionRenderer<ByteArrayOutputStream>

Renderer class which executes JavaScript via SSR and provides the resulting response to Micronaut.

Constructors

Link copied to clipboard
constructor(body: BODY, handler: ElideController, request: HttpRequest<*>, script: ExecutableScript, buffer: StringBuilder = StringBuilder(), job: AtomicReference<Job?> = AtomicReference(null))

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open suspend override fun render(): ByteArrayOutputStream

Render the attached script and return the resulting content as a ByteArrayOutputStream, built from the result of renderSuspendAsync.

Link copied to clipboard
suspend fun renderResponse(response: MutableHttpResponse<ByteArrayOutputStream>): MutableHttpResponse<ByteArrayOutputStream>

Render the attached script into a ByteArrayOutputStream, and wrap it in a Micronaut MutableHttpResponse provided at response.

Link copied to clipboard
suspend fun renderSuspendAsync(): Deferred<String>

Render the attached script with suspension support, and return the resulting content as a regular String.