Skip to content

fmvilas/next-route-to-express-route

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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 👌

Author

Fran Mendez • Twitter

License

Apache 2.0

About

Converts Next.js routes to Express.js routes.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published