[NEED HELP] Routing doesn't work as expected
Closed this issue · 2 comments
itajenglish commented
Hi, @jkyberneees Thank you for making this package. I'm on a pretty hard deadline and have been unable to get the gateway to work the way I want.
As an example, I have my microservice called service-catalog with two routes attached to it, and they are prefixed with the API version as are all the other services /v1/services
and /v1/service-categories
When I add this route to the API gateway the request gets forwarded to the server as /
which returns a 404. How do I get all routes in the gateway to forward the request as is?
const routes = [
{
prefix: '/v1/services',
target: findServiceUrl('service-catalog-service'),
},
{
prefix: '/v1/service-categories',
target: findServiceUrl('service-catalog-service'),
},
];
iapain commented
@itajenglish Please follow the documentation. You may use prefixRewrite
or urlRewrite
to properly route your urls.
itajenglish commented
I was able to get it working! Thank you.