mirror of
https://github.com/CompassConnections/Compass.git
synced 2025-12-31 18:08:40 -05:00
15 lines
572 B
TypeScript
15 lines
572 B
TypeScript
export default async function handler(req: any, res: any) {
|
|
const { path } = req.query; // e.g. "v4FoTtuyX_XwjC3aS2_Y6/Martin.json"
|
|
const upstreamUrl = `https://www.compassmeet.com/_next/data/${path}`;
|
|
|
|
const upstream = await fetch(upstreamUrl);
|
|
const body = await upstream.text();
|
|
|
|
res.setHeader('Content-Type', 'application/json');
|
|
res.setHeader('Access-Control-Allow-Origin', '*');
|
|
res.setHeader('Access-Control-Allow-Methods', 'GET, OPTIONS');
|
|
res.setHeader('Access-Control-Allow-Headers', 'Content-Type');
|
|
|
|
res.status(upstream.status).send(body);
|
|
}
|