Overview
Nitro can generate different output formats suitable for different hosting providers from the same code base.
Using built-in presets, you can easily configure Nitro to adjust it's output format with almost no additional code or configuration!
Default output
Default production output preset is Node.js server.
When running Nitro in development mode, Nitro will always use a special preset called nitro-dev
using Node.js with ESM in an isolated Worker environment with behavior as close as possible to the production environment.
Zero-Config Providers
When deploying to the production using CI/CD, Nitro tries to automatically detect the provider environment and set the right one without any additional configuration. Currently, providers below can be auto-detected with zero config.
Changing the deployment preset
If you need to build Nitro against a specific provider, you can override it using an environment variable or nitro.config.ts
. Using environment variable is recommended for deployments depending on CI/CD.
Example: Using NITRO_PRESET
NITRO_PRESET=aws-lambda nitro build
Example: Using nitro.config.ts
import { defineNitroConfig } from "nitropack/config";
export default defineNitroConfig({
preset: 'node-server'
})