How can I match a route based on query parameters?


#1

I want example.com/user?v=Hsdfjkh to match a video and example.com/user to match the user. How can I do this?


#2

You could do something hacky like: http://jsbin.com/junaqinoca/edit?html,js,output

I’d personally not take the approach of using queryParams here. Instead, would create two routes, one with a slug in the path for the video_id one empty indicating the user


#3

This would work:
example.com/users/:user_id?v=Hsdfjkh