how to define and proxy dynamic params #784
hosein-mirian-maersk
started this conversation in
General
Replies: 1 comment
-
alsi how to pass query and params |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
1)Id like to proxy a url like these:
http://localhost:8000/:apiName/:apiVersion/:route/:id
or a simpler one if u clarify please how to get that I get the whole idea tnx!
http://localhost:8000/staticURL/:DynamicParam
we are needless of using axios due to ur library proxy and somehow pass things automatiicaly to another endpoint right?
what happens to query and body for e.g here in my route I have passed them and need to passed them. do they get passed automatically to the proxy target?
await axios({ method: req.method, url: finalUrl, headers: { 'content-type': 'application/json', 'x-api-key': service.auth.requestAPIKey, 'authorization': req.headers.authorization || null, }, data: req.body, params: req.query,}
Beta Was this translation helpful? Give feedback.
All reactions