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
balexandre patch 1684 #1702
balexandre patch 1684 #1702
Conversation
Took the base code from latest version 6 and applied the version 7 routing. fixes restify#1684
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
why staling this issue ... it's fixed and works as it should before the new version... |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed as stale because it has not had recent activity. |
Reopening this PR. @hekike let me know if I can help in anyway here. |
* @param {String} routeName - the route name | ||
* @param {Object} params - an object of route params | ||
* @param {Object} query - an object of query params | ||
* @returns {String} URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could add an example here, the new API site would render it to the website.
Like:
@example
server.get( { name: 'cities', path: '/countries/:name/states/:state/cities' }, (req, res, next) => ...);
var cities = server.router.render('cities', { name: 'Australia', state: 'New South Wales' });
// cities: '/countries/Australia/states/New%20South%20Wales/cities'
server.router.render('cities', { name: 'Australia' }); | ||
} catch (ex) { | ||
t.equal(ex, 'Error: Route <cities> is missing parameter <state>'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should throw if we catch branch doesn't run
@rajatkumar I added some comments, I'm not sure about @balexandre availability or appetite to address them. Maybe you could help there. I'm fine with merging it first. |
fixed on #1752 |
Took the base code from latest version 6 and applied the version 7 routing.
fixes #1684
Pre-Submission Checklist
make prepush
Issues
Closes:
bringing back the missing but very useful
server.router.render()
to version 7Changes
brings back
server.router.render()