jkyberneees / fastify-gateway

A Node.js API gateway that just works!
https://www.npmjs.com/package/k-fastify-gateway
MIT License
107 stars 14 forks source link

Path parameters? #21

Closed parthibd closed 5 years ago

parthibd commented 5 years ago

Thank you for this amazing library. I have two concerns. First is how do I map a path of my gateway to a totally different prefix in my service. Second, how do I specify path parameters?

jkyberneees commented 5 years ago

Hi @parthibd thanks for your kind words. Can you describe with an example what exactly would you like to have?

Thanks.

parthibd commented 5 years ago

Say my urls are not mapped exactly to the services endpoints. If I pass a path param eg: /user/1/details, and my service endpoint is userdetails/:id. How do I map 1 to the :id?

jkyberneees commented 5 years ago

I will get back to you with an example ASAP.

parthibd commented 5 years ago

Thanks a lot for the prompt reply . :)

jkyberneees commented 5 years ago

Hi @parthibd, you can find an example for this use case here: https://github.com/jkyberneees/fastify-gateway/blob/master/demos/endpoint-proxy.js

Please consider to update the gateway to latest version: https://github.com/jkyberneees/fastify-gateway/releases/tag/v2.2.0

parthibd commented 5 years ago

Thanks a lot. Exactly what I was looking for. :)