Download pages/api/debug.ts from akborana4/websync: direct link, hf CLI and curl.
- Browser
- Download file 387 Bytes
-
https://huggingface.co/spaces/akborana4/websync/resolve/main/pages/api/debug.ts
- Command line
-
hf download hf://spaces/akborana4/websync/pages/api/debug.ts
-
curl -L -o debug.ts https://huggingface.co/spaces/akborana4/websync/resolve/main/pages/api/debug.ts
387 Bytes
| import { getRoom, listRooms } from "../../lib/cache" | |
| import { NextApiRequest, NextApiResponse } from "next" | |
| export default async function debug(_: NextApiRequest, res: NextApiResponse) { | |
| if (process.env.NODE_ENV === "production") { | |
| return res.status(403).end() | |
| } | |
| res.json( | |
| await Promise.all( | |
| (await listRooms()).map(async (room) => await getRoom(room)) | |
| ) | |
| ) | |
| } | |