Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to define multiple routes on a custom server? #419

Closed
YarivGilad opened this issue Dec 17, 2016 · 3 comments
Closed

How to define multiple routes on a custom server? #419

YarivGilad opened this issue Dec 17, 2016 · 3 comments

Comments

@YarivGilad
Copy link

YarivGilad commented Dec 17, 2016

Hi, I need to implement multiple parametized routes like:
/profile/:id , /profile/:id/edit , /item/:id , /item/:id/edit etc...

the 'parameterized-routing' example is using a custom server which uses 'path-match' npm package.
Both the 'parameterized-routing' example and the 'path-match' readme file demonstrate a single route example and I wasn't able to hack my way into implementing multiple routes...

Your help would be very much appreciated
Thank you
Ajar

@arunoda
Copy link
Contributor

arunoda commented Dec 17, 2016

@Ajar-Ajar you could simply use express for that. Use express's routing APIs.
See: https://github.com/zeit/next.js/blob/master/examples/custom-server-express/server.js#L11

@rauchg
Copy link
Member

rauchg commented Dec 17, 2016

For everyone visiting this issue: please note that the custom server API has not been released to npm yet :D

@rauchg rauchg closed this as completed Dec 17, 2016
@YarivGilad
Copy link
Author

Thank you @arunoda !

@lock lock bot locked as resolved and limited conversation to collaborators May 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants