Spaces:
Paused
Paused
Download app/api/user/code/route.ts from fengmuxi/ChatGpt-Web: direct link, hf CLI and curl.
- Browser
- Download file 490 Bytes
-
https://huggingface.co/spaces/fengmuxi/ChatGpt-Web/resolve/main/app/api/user/code/route.ts
- Command line
-
hf download hf://spaces/fengmuxi/ChatGpt-Web/app/api/user/code/route.ts
-
curl -L -o route.ts https://huggingface.co/spaces/fengmuxi/ChatGpt-Web/resolve/main/app/api/user/code/route.ts
490 Bytes
| import { NextRequest } from "next/server"; | |
| import { getIP } from "../../auth"; | |
| export async function POST(req: NextRequest) { | |
| try { | |
| let res=await fetch("https://eladmin.dwzynj.top/auth/code", { | |
| method: "GET", | |
| headers:{ | |
| "UserIp": String(getIP(req)) | |
| } | |
| }) | |
| let msg=await res.json() | |
| // console.log(msg) | |
| return new Response(JSON.stringify(msg)) | |
| } catch (e) { | |
| console.error("[eladmin] ", e); | |
| return new Response(JSON.stringify(e)); | |
| } | |
| } | |