API CORS issues

Post Reply
Posts: 51
Joined: 26 May 2020 18:37
Country: Sweden

API CORS issues

Post by Moru »

I'm playing around with a simple page for alternative way of displaying turf where I can actually see zones (bad eye-sight creeping up). When I tested a few moths ago I could get zones from the API without turning off CORS, but now it does not work any more. Is this by design and I need to cache the zones myself or am I supposed to be able to fetch zones from the API in my javascript app?
Turfname is EQ but forum does not allow that few characters :-)
Posts: 25
Joined: 24 May 2022 22:16
Country: Norway

Re: API CORS issues

Post by LordNorth »

You probably need something in between to relay or proxy your requests so you can set proper CORS headers. For https://turf.mitt.land/ I used Varnish Cache as a proxy.
Post Reply

Return to “Third-party”