Nuxt Server Routes and API Endpoints
server/api/ directory, defineEventHandler(), H3 utilities, middleware, error handling.
Nuxt Is Full-Stack
Nuxt 3 includes a server engine (Nitro). The server/ directory lets you build API endpoints alongside your pages — no separate backend needed for many apps.
The server/api Directory
Files in server/api/ become API routes under /api. server/api/hello.ts responds at /api/hello.
server/
api/
hello.ts -> /api/hello
posts.ts -> /api/postsAll lessons in this course
- Nuxt 3 Project Structure and File-Based Routing
- Data Fetching: useFetch and useAsyncData
- Nuxt Server Routes and API Endpoints
- SSR vs SSG vs SPA Mode