Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vercel/routing-utils

Package Overview
Dependencies
Maintainers
8
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vercel/routing-utils

Vercel routing utilities

  • 2.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
727K
decreased by-19.29%
Maintainers
8
Weekly downloads
 
Created

What is @vercel/routing-utils?

@vercel/routing-utils is a utility package designed to help with routing configurations for Vercel deployments. It provides tools to define and manipulate routes, rewrites, redirects, and headers in a structured and efficient manner.

What are @vercel/routing-utils's main functionalities?

Define Routes

This feature allows you to define custom routes for your application. The 'src' field specifies the incoming request path, and the 'dest' field specifies the destination path.

{
  "routes": [
    { "src": "/about", "dest": "/about.html" },
    { "src": "/blog/(.*)", "dest": "/blog/post?slug=$1" }
  ]
}

Rewrites

Rewrites allow you to map an incoming request path to a different destination path without changing the URL in the browser.

{
  "rewrites": [
    { "source": "/old-path", "destination": "/new-path" }
  ]
}

Redirects

Redirects enable you to redirect an incoming request to a different URL with a specified status code, such as 301 for permanent redirects.

{
  "redirects": [
    { "source": "/old-blog", "destination": "/new-blog", "statusCode": 301 }
  ]
}

Headers

This feature allows you to set custom headers for specific routes. The 'source' field specifies the route, and the 'headers' field contains an array of headers to be set.

{
  "headers": [
    { "source": "/api/(.*)", "headers": [ { "key": "Cache-Control", "value": "no-cache" } ] }
  ]
}

Other packages similar to @vercel/routing-utils

FAQs

Package last updated on 07 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc