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: server & request

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

Nuxt server powered by Nitro

Nuxt's server framework is built on Nitro, which was originally created for Nuxt but is now part of UnJS and is open for use by other frameworks and standalone. Nitro is internally using h3, a minimal HTTP framework built for high performance and portability.

defineEventHandler for server endpoints and middleware

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

defineEventHandler example

Example of defining a server endpoint: ```ts import { defineEventHandler } from 'nitro/h3' export default defineEventHandler(async (event) => { // ... Do whatever you want here }) ``` This example shows a basic server endpoint handler that can be placed in server/api/test.ts.

Nitro universal deployment

Nitro supports deployment to various cloud providers and runtimes including Cloudflare Workers, Netlify Functions, Vercel Cloud, Deno, and Bun. More than 15 deployment presets are available with many offering zero-config deployment.

Nitro benefits for Nuxt

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

Give your agent this brain