Server API endpoints and Middleware are added by Nitro that internally uses h3.
Key features include:
- Handlers can directly return objects/arrays for an automatically-handled JSON response
- Handlers can return promises, which will be awaited (res.end() and next() are also supported)
- Helper functions for body parsing, cookie handling, redirects, headers and more
fromNodeMiddleware
enables the use of legacy handlers and middleware, though they don't play well with Nuxt's automatic scanning of the server/api
directory.
$ nvm use
$ npm run dev
Open http://localhost:3000 with your browser to see the result.