Next.js Go Routes: route.go Arrives in Next.js 16.5

Next.js Go routes shown as a route.go file inside an App Router project

Next.js is breaking its one-language rule. Version 16.5 introduces experimental Next.js Go routes through a new App Router convention called route.go, and it starts a rewrite of the production server in Go. React, TypeScript and Node.js remain the foundation.

The idea is that a backend workload that benefits from a compiled language can live inside the same Next.js app, without a separate service or a second deployment.

Why the Next.js team changed course

For about ten years, UI, server rendering, API routes and proxy logic in Next.js all ran as TypeScript and JavaScript on Node.js. That worked for most teams. Some jobs, like webhook receivers, streaming proxies and CPU-heavy pipelines, could run faster or cheaper in a compiled language, but adopting one meant a second service, a separate build pipeline and router, and engineers switching between toolchains.

The team argues that coding agents have changed that trade. On Vercel, the share of deployments started by coding agents rose from 3% in early 2026 to 60% by November. Vercel took ten years to reach its first billion deployments and ten months to add the next 1.5 billion.

It also cites Anthropic’s move of a busy Python API path to Rust, which lowered CPU per request by about 70% and median time to first token by about 20%.

How route.go works

With experimental.goRoutes enabled, a route.go file can sit anywhere in the app directory and use Go’s standard net/http package. Routing and method conventions match route.ts.

  • Top-level GET, POST, PUT, PATCH, DELETE, HEAD or OPTIONS functions take the standard response writer and request. HEAD falls back to GET, OPTIONS builds an Allow header automatically, and other methods get a 405.
  • Dynamic segments are read with r.PathValue(“id”), and streaming uses http.Flusher.
  • Each route folder is a normal Go package, so neighbouring files, internal imports and go:embed all work.
  • A constant such as MaxDuration = 30 sets static configuration, and Turbopack parses it without running application code.

In development, Turbopack tracks route.go and its dependencies and recompiles only the route that changed. In production builds, every route.go directory compiles into one shared executable, and the Go compiler isn’t needed at runtime.

The team picked Go for quick compiles, a stable standard-library HTTP package, statically linked binaries and a low memory footprint.

The benchmark numbers

On a production workload measured over 200 requests, cumulative active CPU time fell from 23.412 seconds with route.ts to 4.546 seconds with route.go. That is 81% less, or more than five times lower.

A Go-based production server

Running Go routes behind a Node.js server keeps Node on the critical path of every request, so the team is rewriting next start in Go. The first phase owns the public port and sends matching requests straight to Go, while React rendering and TypeScript or JavaScript routes still go to Node.js.

You can try it with the –experimental-new-server flag. In early tests of a route.go endpoint, going directly to Go lifted throughput from 5,956 to 25,818 requests a second (4.3 times higher), cut p99 latency by 59% and reduced CPU per request by 37%.

What happens next

This is the first phase. Handlers written as route.ts, dynamic pages and public files still pass one more proxy hop on Node.js. The team says it is focusing on correctness and parity with current next start behavior before more performance work, and its goal is to rewrite the server fully in Go, including routing, static assets, ISR and caching.

Self-hosting works with next start and the standalone output option, which copies the compiled Go executable with its permissions intact. For other hosts, the team is designing native runtime support into the Adapter API introduced in Next.js 16.2. Its final shape is still open and will be set before route.go leaves experimental status. The team also plans to add more native languages beyond Go over time.

The Next.js Go routes feature changes who can write backend code in a Next.js app. For now, Next.js Go routes are experimental, so production use calls for caution.

Source: nextjs.org

Written by

Saksham Bhargava

Saksham Bhargava runs Alteroid and has been writing about consumer technology for over five years, covering iPhone, Android, Windows, AI tools and gaming. With an MCA and six years of hands-on web development experience, he tests the features he writes about on his own devices and focuses on clear, practical guides that solve real problems. Away from the screen, he enjoys travelling to places most tourists skip.