⚠️ You are looking at the english version of the page. Help us translate it here.
Want to take a look at our new docs? Our new docs are now in beta. Have fun!

The Renderer Class

This class is exporting a connect middleware which handles and serves all SSR and asset requests.

Hooks

We can register hooks on certain life cycle events.

HookArgumentsWhen
render:before(renderer, options)Before setting up middleware and resources for the Renderer class, useful to overload some methods or options.
render:setupMiddleware(app) connect instanceBefore Nuxt adds its middleware stack. We can use it to register custom server side middleware.
render:errorMiddleware(app) connect instanceBefore adding Nuxt error middleware, useful to add your own middleware before using Nuxt's. See the Sentry module for more info.
render:resourcesLoaded(resources)Called after resources for renderer are loaded (client manifest, server bundle, etc).
render:done(renderer)SSR Middleware and all resources are ready (Renderer ready)
render:routeContext(context.nuxt)Every time a route is server-rendered and before render:route hook. Called before serializing Nuxt context into window.__NUXT__, useful to add some data that you can fetch on client-side.
render:route(url, result, context)Every time a route is server-rendered. Called before sending back the request to the browser.
render:routeDone(url, result, context)Every time a route is server-rendered. Called after the response has been sent to the browser.

Contributors

Contribution for this page is now closed. If you would like to contribute please check out our new docs are now in beta. Have fun!

Platinum Sponsors

StoryblokMoovweb Support Us