Download server/api/[...].ts from binhugg4/web: direct link, hf CLI and curl.
- Browser
- Download file 285 Bytes
-
https://huggingface.co/spaces/binhugg4/web/resolve/main/server/api/%5B...%5D.ts
- Command line
-
hf download 'hf://spaces/binhugg4/web/server/api/[...].ts'
-
curl -L -o '[...].ts' https://huggingface.co/spaces/binhugg4/web/resolve/main/server/api/%5B...%5D.ts
285 Bytes
| import type { H3Event } from "h3"; | |
| export default defineEventHandler(async (event: H3Event) => { | |
| const config = useRuntimeConfig(); | |
| const targetPath = event.path.replace(/^\/api/, ""); | |
| const target = `${config.apiBaseUrl}${targetPath}`; | |
| return proxyRequest(event, target); | |
| }); |