routing-middleware

Intercept requests before cache to apply rewrites, redirects, and routing rules.

Updated May 31, 2026
One-click install
npx skills add https://github.com/ChristineTham/lp --skill routing-middleware-christinetham
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: routing-middleware
Source: https://github.com/ChristineTham/lp/tree/main/.agents/skills/routing-middleware
Command: npx skills add https://github.com/ChristineTham/lp --skill routing-middleware-christinetham

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Vercel Routing Middleware runs before the cache to intercept requests at the platform level, enabling rewrites, redirects, geo-based routing, and per-request personalization across frameworks. It supports Edge, Node.js, and Bun runtimes and helps teams apply cross-cutting routing logic without coupling to a specific framework.

Core Features & Use Cases

  • Intercept requests before cache to apply rewrites, redirects, and routing rules.
  • Supports multiple runtimes (Edge, Node.js, Bun) and works with any framework.
  • Provides guidance on common patterns (IP-based routing, A/B testing, and proxy behavior) and the necessary file patterns (middleware.ts vs proxy.ts) for migration and clarity.

Quick Start

Create a root middleware file and export a default handler to begin intercepting requests.

Frequently Asked Questions about routing-middleware

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

FAQPage Schema
How do I intercept requests at the platform level before hitting the cache?

To intercept requests at the platform level before hitting the cache, you create a root middleware file and export a default handler to apply rewrites, redirects, and routing rules. This enables per-request personalization across frameworks.

Does Vercel routing middleware work with Node.js and Bun runtimes?

Yes, Vercel routing middleware works across multiple runtimes including Edge, Node.js, and Bun. It applies cross-cutting routing logic without coupling your application to a specific framework.

What is the difference between middleware.ts and proxy.ts for request interception?

The difference between middleware.ts and proxy.ts involves file naming patterns for migration and clarity in request interception. Proper naming ensures correct routing rules and proxy behavior are applied at the platform level.

How do I set up IP-based routing and A/B testing with edge middleware?

To set up IP-based routing and A/B testing with edge middleware, you implement request interception patterns within your default handler. This allows you to apply geo-based routing and personalization before the cache.

Why do I need matcher configuration for request interception middleware?

You need matcher configuration for request interception middleware to optimize performance by targeting specific request paths. Without it, the middleware runs on every request, potentially slowing down your application.

Can I apply redirects and rewrites without coupling to a specific framework?

Yes, you can apply redirects and rewrites without coupling to a specific framework by using platform-level routing middleware. It operates across frameworks and runtimes to handle cross-cutting routing logic before the cache.