
Nitro Has a Free API That Powers Universal Server-Side JavaScript Deployments
Nitro is the server engine behind Nuxt, Analog, and Vinxi. It compiles your server-side code to run anywhere: Node, Deno, Bun, Cloudflare Workers, Vercel, Netlify, AWS Lambda — from one codebase. Quick Start npx giget@latest nitro my-app cd my-app && npm install && npm run dev API Routes // routes/api/hello.ts export default defineEventHandler (( event ) => { return { hello : ' world ' } }) // routes/api/users/[id].ts export default defineEventHandler (( event ) => { const id = getRouterParam ( event , ' id ' ) return { userId : id } }) Deploy Anywhere # Build for different platforms NITRO_PRESET = vercel npx nitropack build NITRO_PRESET = cloudflare npx nitropack build NITRO_PRESET = netlify npx nitropack build NITRO_PRESET = node-server npx nitropack build NITRO_PRESET = deno-server npx nitropack build NITRO_PRESET = bun npx nitropack build Same code, different deployment target. Change one env var. Key Features Auto-imports : No import statements needed for utilities File-based rout
Continue reading on Dev.to JavaScript
Opens in a new tab

