diff --git a/public/_redirects b/public/_redirects new file mode 100644 index 0000000..2da7a1c --- /dev/null +++ b/public/_redirects @@ -0,0 +1,3 @@ +# /_redirects + +/api/* https://takebackday.infoloom.com/:splat \ No newline at end of file diff --git a/src/gateways/locations.js b/src/gateways/locations.js index 0a7bdbe..9e7791a 100644 --- a/src/gateways/locations.js +++ b/src/gateways/locations.js @@ -1,6 +1,8 @@ import mockData from '../mockData'; -const jsonEndpoint = 'https://takebackday.infoloom.com/media/output.json'; +// Actual host url is set in redirects file to avoid CORS +// Will not work locally, so endpoint will just return default data from file +const jsonEndpoint = '/api/media/output.json'; export const fetchLocations = () => ( fetch(jsonEndpoint)