Microgateway use url parameters to build target url

I have a task to defile 3 different proxies for next URLs

/v2/{site}/users/{userId}/items

/v2/{site}/users/{userId}/items/{itemId}

/v2/{site}/users/{userId}/items/{itemId}/elements

I'm able to use wildcard mapping to define the proxy endpoint, but could not find the way, how can I get parameters {userId}, {site}, {itemId} from the URL to build proper targetUrl which differs a bit.


Could you please suggest some best practices, how can we reach this using Microgateway?

0 2 335
2 REPLIES 2

Former Community Member
Not applicable

To the best of my knowledge, you don't get parameters. You'll only have access to req.url. From there you'll have to parse to get the parameters.

Are there some articles that describe the detailed way how to do this? As i understand we have to write a JS plugin?