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

next-routes-now

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-routes-now

CLI tool to generate next-routes for Now 2.0

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
46
increased by206.67%
Maintainers
1
Weekly downloads
 
Created
Source

Usage

To install the latest version of Next Routes for Now CLI, run this command:

npm install -g next-routes-now
# or
yarn global add next-routes-now

Or install locally:

npm install next-routes-now
# or
yarn add next-routes-now

Generate routes

generate-now-routes <routes.json> [-A <now.json>]

Usage

Description

Usage
  $ generate-now-routes <routes_file> [options]

Options
  --help, -h          Display this message
  --version, -v       Display version
  --local-config, -A  Path to the local `now.json` file

Routes config json example

Define your Now 2 rules in routes.json. To build your next-routes use the build key to compose your next-routes into your now.json.

[
  {
    "src": "/_next/static/(.*)",
    "dest": "/_next/static/$1",
    "headers": { "cache-control": "s-maxage=86400" },
    "continue": true
  },
  {
    "build": "routes.js"
  }
]

Can also be used programatically

const generate = require("next-routes-now")

genaret.buildAndUpdate(pathToRoutes, pathToNow);

With prefix

If you files are not located at the root of your project, say in a monorepo, you can use the prefix key:

[
  {
    "build": "routes.js",
    "prefix": "/packages/web"
  }
]

FAQs

Package last updated on 25 Jun 2019

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