ky in the vite environment request hint cors.
lihe6666 opened this issue · comments
lion commented
Marvin commented
In order to make use of your proxy, your request URL must be relative.
So instead of making the request with ky.get("http://my.live.server.com/smallApps/)
, you can make use of ky.get("/smallApps/")
.
This would mean in local-development the request goes to http://localhost:5147
and is handled by your proxy and in production (assuming it's running the same domain) the request goes http://my.live.server.com
.
In case you want to configure the base URL manually (via JS), you can make use of ky prefix-url
option