This episode covers deploying Nuxt on an edge runtime: the edge network concept, serverless functions with the Nitro server, runtime differences and environment considerations, and edge versus serverless use cases for different application types.

After successfully deploying, the next question is: where should the application run? Episode 21 covers two main models — edge runtime and serverless — and how Nuxt and Nitro bridge both.
The difference matters because it determines latency, pricing, and limits on the execution environment. Applications that need super-fast responses worldwide fit the edge; applications with heavy workloads or full Node.js feature needs are more comfortable on traditional serverless. Nuxt makes switching between the two a matter of changing a preset.
An edge network places servers in many locations around the world. Code runs at the location closest to the user, so latency is extremely low — ideal for pages that need fast responses from anywhere.
Nuxt supports the edge through Nitro presets, for example Cloudflare:
export default defineNuxtConfig({
nitro: {
preset: "cloudflare_pages",
},
})The cloudflare_pages preset translates the Nuxt application into a form that runs on Cloudflare's edge network. The build is then deployed through their dashboard or CLI.
The edge runtime doesn't run Node.js fully. A few things to keep in mind:
Test the application on an edge preset from the start, not at the end. You can write environment-aware code that doesn't depend on specific Node.js features.
With a serverless preset like vercel or netlify, the whole Nuxt server is translated into serverless functions. Every server route becomes a function endpoint:
export default defineEventHandler(async (event) => {
const body = await readBody(event)
return { status: "diterima", id: buatId() }
})This server route automatically becomes a serverless function on the target platform. No code changes — you keep writing defineEventHandler as usual.
Serverless handles scale well: the platform adds instances automatically when traffic rises, and scales to zero when quiet. You pay per execution, not per server hour. This makes serverless a good fit for workloads with unpredictable traffic.
The three runtimes differ in important ways:
Code must consider its environment. Don't write code that only runs on Node if the target is the edge:
if (process.env.NODE_ENV === "production") {
console.log("mode produksi aktif")
}process.env.NODE_ENV is available on most runtimes. However, to access storage at the edge, use the APIs the preset provides — for example useStorage with a supported KV backend.
Also note: deployment size, execution duration, and environment variables differ across platforms. Document environmental assumptions in the README so the team understands the limits to respect.
The edge is best for:
If most pages can be cached, the edge delivers maximum speed at minimal cost.
Serverless is more comfortable for:
Combinations are also common: public pages at the edge, while transactional API endpoints run on serverless. Nuxt enables this granularity through per-route configuration on several platforms.
Episode 21 explains your runtime options: edge for the lowest latency with environment limits, serverless for near-complete Node.js flexibility with automatic scaling, and a Node server for full control. With Nitro, moving between runtimes is just a matter of changing a preset.
Key takeaways:
In the next episode, episode 22, we will discuss observability and monitoring — monitoring frontend and server performance, error tracking with Sentry, real user monitoring and analytics, and production support and incident handling.