Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fmvilas/next-route-to-express-route

Converts Next.js routes to Express.js routes.
https://github.com/fmvilas/next-route-to-express-route

express expressjs nextjs nodejs route

Last synced: 5 days ago
JSON representation

Converts Next.js routes to Express.js routes.

Awesome Lists containing this project

README

        

# next-route-to-express-route

Converts Next.js routes to Express.js routes.

```
npm i next-route-to-express-route
```

```js
const { fromNextToExpressRoute } = require('next-route-to-express-route')

console.log(fromNextToExpressRoute('/users/[id]/profile'))
// => '/users/:id/profile'
```

It works with catch-all routes too:

```js
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](https://twitter.com/fmvilas)

## License

Apache 2.0