View Source Inertia.SSR (Inertia v3.0.0-rc2)

Supervisor that provides server-side rendering support for Inertia views.

By default SSR is performed by a pool of Node.js workers (Inertia.SSR.NodeJSAdapter). You can plug in an alternative runtime by implementing the Inertia.SSR.Adapter behaviour and passing the module as the :ssr_adapter option.

Summary

Functions

Returns a specification to start this module under a supervisor.

Starts the SSR supervisor and its adapter children.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(init_arg)

Starts the SSR supervisor and its adapter children.

Options

Any additional options are forwarded to the adapter's Inertia.SSR.Adapter.init/1 callback. The default Node.js adapter accepts:

  • :path - (required) the path to the directory where your ssr.js file lives.
  • :module - (optional) the name of the Node.js module file. Defaults to "ssr".
  • :esm - (optional) whether the SSR entrypoint is an ESM module. If unset, ESM is auto-detected from a .mjs module extension.
  • :pool_size - (optional) the number of Node.js workers. Defaults to 4.