routing-middleware

Intercept HTTP requests to apply rewrites, redirects, and header changes.

1|Updated Apr 8, 2026
One-click install
npx skills add https://github.com/masermediagroup-stack/CursorSkills --skill routing-middleware-masermediagroup-stack
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: routing-middleware
Source: https://github.com/masermediagroup-stack/CursorSkills/tree/main/skills-bundle/plugins-vercel/eb3b6f19e9ca59b23c88d7cc8dfe609388be0fc7/skills/routing-middleware
Command: npx skills add https://github.com/masermediagroup-stack/CursorSkills --skill routing-middleware-masermediagroup-stack

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Platform-level request interception is essential for routing control before frameworks and caches. This Skill provides guidance on building and configuring Vercel Routing Middleware to inspect, rewrite, redirect, or augment traffic at the edge, independent of your app code.

Core Features & Use Cases

  • Intercept requests before the cache and route them using middleware logic.
  • Apply rewrites, redirects, and header changes globally across frameworks.
  • Support for Edge, Node.js, and Bun runtimes; migration guidance for Next.js 16 proxy.ts patterns.

Quick Start

Create a root-level middleware.ts or middleware.js that exports a default function (and an optional config) to enable platform-level request interception.

Frequently Asked Questions about routing-middleware

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

FAQPage Schema
How do I set up edge middleware for redirects and rewrites in Next.js?

Edge middleware for redirects and rewrites requires a root-level middleware.ts or middleware.js file exporting a default function and optional runtime config to intercept platform-level HTTP requests before content is served.

What does Vercel routing middleware do before the cache?

Vercel routing middleware inspects, rewrites, redirects, or augments HTTP traffic at the edge before frameworks and caches process the request, operating independently of your application code.

Can I use routing middleware with Node.js and Bun runtimes on Vercel?

Yes, routing middleware applies across Edge, Node.js, and Bun runtimes to support A/B routing, geo-based redirects, and header management in production deployments.

Do I need a proxy.ts file for middleware in Next.js 16?

For Next.js 16, you use a root-level proxy.ts file instead of middleware.ts to export the default function and enable platform-level request interception.

How do I apply geo-based redirects and header changes globally across frameworks?

Create a root-level middleware file exporting a default function to intercept requests globally, applying geo-based redirects and header changes across frameworks before the cache.

Why intercept HTTP requests at the platform edge instead of in the app code?

Intercepting HTTP requests at the platform edge allows you to apply rewrites, redirects, and header changes before frameworks and caches process traffic, ensuring routing control independent of app code.