So, I’ve got two GET endpoints on my server app: GET /measurement?param=... (let’s call it find) and GET /measurement/<id>?param=... (let’s call it get)
and I created two config files in my Tyk project for them separately. For the find one:
But no matter whether I request GET /read/all?param=... or GET /read/123?param I always hit the find endpoint. So, I am thinking that for the get endpoint configuration, I need to add something after the / slashes of each config property, that will signify that there is a URL param.
Can you share your Tyk log from when the gateway starts or hot reloads? It should list out the heirarchy of what it is listening for.
If you have two APIs, then read/all will be matched before read/
I would suggest that to debug, get rid of the rewrite, and instead point your app at httpbin (which echoes back the request metadata that it receives), and then use the header injector instead of the rewriter to make sure that the capture pattern is working.
Once you’re certain it;s not the initial path match failing, then transpose that same config to the rewriter. Since you are not really using the rewriter to transpose data from the URL into the new one, you could just use wide regexes like (.*) for the match pattern, because they are for extracting and moving data, they shouldn;t affect the match itself ass that’s already happened.
Another thing you could do is have a single API definition that listens on /read/`, Then have it rewrite like this:
I assumed you were using the dashboard, which sorts routes by length for you before they are saved, if you are using file based mode then you need to add it manually.