-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Path variables à la express #58
Comments
Hi @enricodeleo, unfortunately this feature is not implemented at the moment. Can you check that it works for you? |
Yes I think I'll end up using that hook like I did for response transformations. Actually, I think the my proposed interface is near to be available, at least the prefix part is already working. In fact, in this scenario {
pathRegex: '/:group/:id/products',
prefix: '/partners',
prefixRewrite: '/api/v1.0/partners',
target: API_HOST,
hooks: {
rewriteRequestHeaders(req, headers) {
req.log.debug(req);
headers['accept-encoding'] = 'identity';
return headers;
},
},
}, I can see The only part missing is a function that would parse target url as well. It would be super helpful when using fast-gateway as a migration tool for legacy apis (you could use it in order to listen to request urls in a more "standard" way and then piece by piece migrate each endpoint to its own microservice). |
I understand and I agree with you, let me come up with a flexible approach to update the path or request url without going into the hooks... Stay tuned |
Any chances you had some idea on how to address it? |
Hi @enricodeleo, excuse me for the delay on this. What do you think about this proposal? |
no reason to excuse, you already gave us a great tool! so thank you for the time you spent into this new feature. It does look like a great api ! |
Hi @enricodeleo, the new |
In Express environment is common to express routes like
/user/:userId/group
whereuserId
is a variable that can be used across middlewares.I would find awesome an interface like
Would it be possible?
The text was updated successfully, but these errors were encountered: