mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-02-25 03:16:37 -05:00
* 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
15 lines
561 B
TypeScript
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)
|
|
}
|