We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a971c12 commit 4cf783fCopy full SHA for 4cf783f
web/pages/api/proxy-data.ts
@@ -0,0 +1,14 @@
1
+export default async function handler(req: any, res: any) {
2
+ const { path } = req.query; // e.g. "v4FoTtuyX_XwjC3aS2_Y6/Martin.json"
3
+ const upstreamUrl = `https://www.compassmeet.com/_next/data/${path}`;
4
+
5
+ const upstream = await fetch(upstreamUrl);
6
+ const body = await upstream.text();
7
8
+ res.setHeader('Content-Type', 'application/json');
9
+ res.setHeader('Access-Control-Allow-Origin', '*');
10
+ res.setHeader('Access-Control-Allow-Methods', 'GET, OPTIONS');
11
+ res.setHeader('Access-Control-Allow-Headers', 'Content-Type');
12
13
+ res.status(upstream.status).send(body);
14
+}
0 commit comments