I have two different API backends running on ports 8080 and 9090. I am developing frontend with gatsby.
Is it possible to proxy /api/specific-path to one backend (example to 9090) and all other /api calls to the other backend (8080)?
Tried this in gatsby-config.js, but all /api requests are going to 8080:
proxy: [
{
prefix: "/api",
url: "http://localhost:8080",
},
{
prefix: "/api/specific-path",
url: "http://localhost:9090",
},
],
Perhaps using nginx as reverse proxy for backends, and sorting requests there would solve the problem, but ideally I would like to avoid setting up extra services for local development.