

Nuxt 3 generates this dist when running nuxt build into a. The server in Nuxt 2 is not standalone and requires part of Nuxt core to be involved by running nuxt start (with the nuxt-start or nuxt distributions) or custom programmatic usage, which is fragile and prone to breakage and not suitable for serverless and service-worker environments.

Nitro produces a standalone server dist that is independent of node_modules. You can access these types when using $fetch() or useFetch(). When using API routes (or middleware), Nitro will generate typings for these routes as long as you are returning a value instead of using res.end() to send a response.

Automatic parsing of JSON responses (with access to raw response if needed).$fetch API is using ofetch, with key features including: This will make an API call to the server if run on the browser, but will directly call the relevant function if run on the server, saving an additional API call. Nitro allows 'direct' calling of routes via the globally-available $fetch helper. Learn more about the API layer in the server/ directory.
