Skip to content
Jakob Rosenberg edited this page Jan 31, 2020 · 1 revision

Functions

beforeEval(dom)

Called before the app script is evaluated

afterEval(dom)

Called after the app script is evaluated

ssr(template, script, url, [options])string

Renders an HTML page from a HTML template, an app bundle and a path

beforeEval(dom)

Called before the app script is evaluated

Kind: global function

Param Type Description
dom object The DOM object

afterEval(dom)

Called after the app script is evaluated

Kind: global function

Param Type Description
dom object The DOM object

ssr(template, script, url, [options]) ⇒ string

Renders an HTML page from a HTML template, an app bundle and a path

Kind: global function

Param Type Description
template string Html template (or path to a HTML template).
script string Bundled JS app (or path to bundled bundle JS app).
url string Path to render. Ie. /blog/breathing-oxygen-linked-to-staying-alive
[options] object Options
[options.host] string hostname to use while rendering. Defaults to http://jsdom.ssr
[options.eventName] string event to wait for before rendering app. Defaults to 'app-loaded'
[options.beforeEval] domFn Executed before script is evaluated.
[options.afterEval] domFn Executed after script is evaluated.
[options.meta] object Metadata to be applied to the HTML element. Defaults to { 'data-render': 'ssr' }
Clone this wiki locally