routing-middleware

Intercept and rewrite web requests across Edge, Node.js, and Bun runtimes.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/namhoangg/agent-starter-kit --skill routing-middleware-namhoangg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: routing-middleware
Source: https://github.com/namhoangg/agent-starter-kit/tree/main/cursor/skills/routing-middleware
Command: npx skills add https://github.com/namhoangg/agent-starter-kit --skill routing-middleware-namhoangg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Vercel Routing Middleware provides a platform-level interception layer to modify, rewrite, or redirect requests before they reach your app, enabling flexible routing, A/B testing, geo-personalization, and header control across frameworks.

Core Features & Use Cases

  • Intercept and rewrite requests at the edge to implement redirects, rewrites, or geo-aware routing.
  • Works with Next.js, SvelteKit, Astro, Nuxt, or any framework, across Edge, Node.js, and Bun runtimes.
  • Configure precise matching with config.matcher to scope middleware to specific routes and avoid unnecessary compute.

Quick Start

Create a root middleware.ts (or proxy.ts for Next.js 16 proxy) and deploy with vercel to begin intercepting requests at the platform edge.

Frequently Asked Questions about routing-middleware

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I intercept and rewrite requests at the edge before they reach my app?

To intercept and rewrite requests at the edge, create a root middleware.ts file and deploy with Vercel to modify web traffic before it hits your application routes. This enables flexible routing and header control across frameworks.

Does Vercel edge middleware work with Next.js, SvelteKit, Astro, and Nuxt?

Vercel edge middleware works with Next.js, SvelteKit, Astro, Nuxt, or any framework across Edge, Node.js, and Bun runtimes. It provides a platform-level interception layer to modify or redirect requests consistently.

How do I scope middleware to specific routes to avoid unnecessary compute?

Scope middleware to specific routes and avoid unnecessary compute by configuring precise matching with config.matcher in your root middleware.ts file. This limits interception to designated paths only.

Do I need proxy.ts instead of middleware.ts for Next.js 16?

For Next.js 16, you need to create a proxy.ts file instead of middleware.ts to satisfy runtime configuration and file placement requirements. This handles request interception and migration notes properly.

Can I use edge middleware for geo-personalization and A/B testing?

Edge middleware supports geo-personalization and A/B testing by intercepting requests at the platform level to rewrite or redirect them before they reach your app. This enables dynamic, location-aware routing.