Node.js Deployment
Default Preset
This is the default nitro output preset for production builds.
When running nitro build
with the Node server preset, the result will be an entry point that launches a ready-to-run Node server. To try output:
You can now deploy fully standalone .output
directory to the hosting of your choice.
NITRO_HOST
orHOST
(defaults to'0.0.0.0'
)
Handler (advanced)
Preset: node
()
Nitro also has a more low-level preset that directly exports a function with (req, res) => {}
signature usable for middleware and custom servers.
Example: