Node.js server
Default preset if none is specified or auto-detected
Loads only the required chunks to render the request for optimal cold start timing
Useful for debugging
Back to presets list.
You can use the to explicitly set the preset to use:
nuxt.config.js|ts
NITRO_PRESET=server npx nuxt build
When running nuxt build
with the Node server preset, the result will be an entry point that launches a ready-to-run Node server.
Listening on http://localhost:3000
This preset will respect the following runtime environment variables:
NUXT_PORT
orPORT
(defaults to )NUXT_HOST
orHOST
(defaults to'localhost'
)NITRO_SSL_CERT
andNITRO_SSL_KEY
- if both are present, this will launch the server in HTTPS mode. In the vast majority of cases, this should not be used other than for testing, and the Nitro server should be run behind a reverse proxy like nginx or Cloudflare which terminates SSL.
You can enable the nitro.timing
option to have the logs about the chunk loading and cold start performance.
$ node .output/server/index.mjs
> Load chunks/nitro/static (0ms)
> Load chunks/app/render (1ms)
> Load chunks/app/client.manifest (0ms)
> Load chunks/index (3ms)
> Load chunks/app/server (2ms)
> Load chunks/app/vue3 (0ms)