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

Pass route params to handlers. #29

Merged
merged 2 commits into from
Jul 26, 2019
Merged

Pass route params to handlers. #29

merged 2 commits into from
Jul 26, 2019

Conversation

Frando
Copy link
Contributor

@Frando Frando commented Jul 24, 2019

The find-my-way router already supports parsing route params.This PR simply passes the extracted route params on into the route handler, so that they can be used and don't have to be parsed again.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nice!!!!

@@ -286,3 +286,32 @@ test(`Should return 404 on http request`, t => {
t.end()
})
})

test('Should pass route params to handlers', t => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we test also the params empty case?
So we will not have regression in future

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, I added a test with empty params.

@Eomm Eomm merged commit 0405db1 into fastify:master Jul 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants