Files
Compass/web/pages/api/proxy-data.ts
Martin Braquet ba9b3cfb06 Add pretty formatting (#29)
* Test

* Add pretty formatting

* Fix Tests

* Fix Tests

* Fix Tests

* Fix

* Add pretty formatting fix

* Fix

* Test

* Fix tests

* Clean typeckech

* Add prettier check

* Fix api tsconfig

* Fix api tsconfig

* Fix tsconfig

* Fix

* Fix

* Prettier
2026-02-20 17:32:27 +01:00

15 lines
561 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)
}