3 ms·
Maybe this is obvious, but why not just configure a reverse proxy to point different paths to different backends? I always assumed CORS was more for connecting
by tlrobinson 11y ago
Maybe this is obvious, but why not just configure a reverse proxy to point different paths to different backends?
I always assumed CORS was more for connecting directly to 3rd party APIs.
- HorizonXP 11y agoThat's how I do it. Not sure what the benefit of having your API on a separate sub-domain is.
- pyre 11y agoCORS is just about cross-domain requests. That's it. This covers 3rd part APIs and hitting api.* from a www.* page.
- kevan 11y agoSounds like they're hosted entirely on Heroku and didn't want to go through the effort of adding external infrastructure. But I just found out apparently you can host Nginx on Heroku [1] which is neat, but looks a bit sketchy [1] https://github.com/ryandotsmith/nginx-buildpack https://github.com/ryandotsmith/nginx-buildpack