You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I'm hosting a static single page app, this package is a godsend, appreciate it so much.
My question comes when this SPA makes cross-domain calls to an api server; it can work but the overhead of the options requests, the sketchiness of CORS, etc, can cause some problems/complexity.
In other projects, I've setup something where /api is a proxy service that takes /api/* and passes on all headers, paths, etc to a predefined host.
I'm curious if anyone has any advice on how to pull this off w/ this or a similar project.
My Dockerfile w/ an example of how I might use the proxy:
Then if this Dockerfile was deployed to static.example.com and that project has an API call that it's GET /api/foo/1, it'd be a local request but would get proxied to GET https://api.example.com/foo/1 eliminated cross domain requests.
Thanks for any advice; I'd be more than happy to try this out on my own if it would be of interest.
The text was updated successfully, but these errors were encountered:
If I'm hosting a static single page app, this package is a godsend, appreciate it so much.
My question comes when this SPA makes cross-domain calls to an api server; it can work but the overhead of the options requests, the sketchiness of CORS, etc, can cause some problems/complexity.
In other projects, I've setup something where
/api
is a proxy service that takes/api/*
and passes on all headers, paths, etc to a predefined host.I'm curious if anyone has any advice on how to pull this off w/ this or a similar project.
My Dockerfile w/ an example of how I might use the proxy:
Then if this Dockerfile was deployed to
static.example.com
and that project has an API call that it'sGET /api/foo/1
, it'd be a local request but would get proxied toGET https://api.example.com/foo/1
eliminated cross domain requests.Thanks for any advice; I'd be more than happy to try this out on my own if it would be of interest.
The text was updated successfully, but these errors were encountered: