Skip to content

Commit 6a71902

Browse files
fix: add CORS headers to the active and releases routes (#182)
1 parent 377a609 commit 6a71902

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

app/api/active.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import { getActiveReleasesOrUpdate } from '~/data/release-data';
22

33
export const loader = async () => {
4-
return await getActiveReleasesOrUpdate();
4+
return Response.json(await getActiveReleasesOrUpdate(), {
5+
headers: {
6+
'Access-Control-Allow-Origin': '*',
7+
'Access-Control-Allow-Methods': 'GET, OPTIONS',
8+
'Access-Control-Allow-Headers': 'Content-Type',
9+
},
10+
});
511
};

app/api/releases.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import { getReleasesOrUpdate } from '~/data/release-data';
22

33
export const loader = async () => {
4-
return await getReleasesOrUpdate();
4+
return Response.json(await getReleasesOrUpdate(), {
5+
headers: {
6+
'Access-Control-Allow-Origin': '*',
7+
'Access-Control-Allow-Methods': 'GET, OPTIONS',
8+
'Access-Control-Allow-Headers': 'Content-Type',
9+
},
10+
});
511
};

0 commit comments

Comments
 (0)