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 · Guide · all subjects

plugins & server engine

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

Server-only pattern example for SEO meta tags

To set SEO meta tags only on the server side, wrap useSeoMeta in an if (import.meta.server) block. Example: ```vue <script setup lang="ts"> if (import.meta.server) { useSeoMeta({ robots: 'index, follow', }) } </script> ```

useServerSeoMeta is deprecated

The useServerSeoMeta composable is deprecated. It should not be used for new code. The auto-import is removed under future.compatibilityVersion: 5.

useServerSeoMeta replacement pattern

Instead of useServerSeoMeta, wrap useSeoMeta in an if (import.meta.server) block to only run server-side and tree-shake from the client bundle.

useServerSeoMeta functionality before deprecation

useServerSeoMeta lets you define your site's SEO meta tags as a flat object with full TypeScript support, exactly like useSeoMeta, but it only runs server-side and is tree-shaken from the client bundle.

Nuxt server powered by Nitro

Nuxt's server is Nitro, an open-source HTTP framework originally created for Nuxt but now part of UnJS and available for other frameworks. Nitro internally uses h3, a minimal HTTP framework built for high performance and portability.

Nitro capabilities in Nuxt

Nitro gives Nuxt full control of the server-side part of the application, universal deployment on any provider with many zero-config options, and hybrid rendering capabilities.

Server endpoints and middleware definition

Both server endpoints and middleware in Nuxt are defined using the defineEventHandler function from 'nitro/h3'. The handler receives an event object and can return text, json, html, or a stream. They support hot module replacement and auto-import out-of-the-box.

Server endpoint and middleware example

Example of a server endpoint definition: ```ts import { defineEventHandler } from 'nitro/h3' export default defineEventHandler(async (event) => { // ... Do whatever you want here }) ``` This pattern applies to files in the server/api directory and other server directories.

Give your agent this brain