Skip to content

Commit d8ae349

Browse files
committed
Proxy requests to api to avoid cors
1 parent 7936da4 commit d8ae349

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

_redirects

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# /_redirects
2+
3+
/api/* https://takebackday.infoloom.com/:splat

src/gateways/locations.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import mockData from '../mockData';
22

3-
const jsonEndpoint = 'https://takebackday.infoloom.com/media/output.json';
3+
// Actual host url is set in redirects file to avoid CORS
4+
const jsonEndpoint = '/api/media/output.json';
45

56
export const fetchLocations = () => (
67
fetch(jsonEndpoint)

0 commit comments

Comments
 (0)