new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Nuxt · API · all subjects

composables/prerender-routes

7 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

prerenderRoutes composable signature

prerenderRoutes is a composable that hints to Nitro to prerender additional routes. It accepts either a single route string or an array of route strings as arguments. Example: prerenderRoutes('/') or prerenderRoutes(['/', '/about']).

prerenderRoutes minimum version

The prerenderRoutes composable is available in Nuxt versions 3.8 and later.

prerenderRoutes must be called in Nuxt context

prerenderRoutes can only be called within the Nuxt context. It cannot be used outside of this context.

prerenderRoutes execution timing during prerendering

prerenderRoutes must be executed during the prerendering phase. If used in dynamic pages or routes that are not prerendered, it will not be executed.

prerenderRoutes has no effect in browser or outside prerendering

In the browser, or if called outside prerendering, prerenderRoutes will have no effect.

prerenderRoutes with API routes for SSG

prerenderRoutes can prerender API routes, which is useful for full statically generated sites (SSG). This allows you to $fetch data as if a server is available. Example: prerenderRoutes('/api/content/article/name-of-article') followed by const articleContent = await $fetch('/api/content/article/name-of-article', { responseType: 'json', }).

Prerendered API routes response headers warning

Prerendered API routes in production may not return the expected response headers depending on the deployment provider. For example, a JSON response might be served with application/octet-stream content type instead of application/json. Always manually set responseType when fetching prerendered API routes.

Give your agent this brain