0.2.0 • Published 5 years ago
next-route-to-express-route v0.2.0
next-route-to-express-route
Converts Next.js routes to Express.js routes.
npm i next-route-to-express-route
const { fromNextToExpressRoute } = require('next-route-to-express-route')
console.log(fromNextToExpressRoute('/users/[id]/profile'))
// => '/users/:id/profile'
It works with catch-all routes too:
const { fromNextToExpressRoute } = require('next-route-to-express-route')
console.log(fromNextToExpressRoute('/users/[...]'))
// => '/users/*'
That's it! It's just a simple utility package :ok_hand:
Author
Fran Mendez • Twitter
License
Apache 2.0