Download agy2api/frontend/src/basePath.js from a3216/ds2api: direct link, hf CLI and curl.
- Browser
- Download file 490 Bytes
-
https://huggingface.co/spaces/a3216/ds2api/resolve/main/agy2api/frontend/src/basePath.js
- Command line
-
hf download hf://spaces/a3216/ds2api/agy2api/frontend/src/basePath.js
-
curl -L -o basePath.js https://huggingface.co/spaces/a3216/ds2api/resolve/main/agy2api/frontend/src/basePath.js
490 Bytes
| // 计算控制面板的基径(以 "/" 开头并以 "/" 结尾) | |
| // 面板是单入口应用,文档地址即挂载点:根路径部署为 "/",反代子路径部署为 | |
| // "/AGY2API/" 等形式。部分反代不补齐末尾斜杠,访问地址可能为 "/AGY2API", | |
| // 此处统一补齐,保证 API 请求与页面跳转落在同一子路径下 | |
| export function getBasePath() { | |
| const { pathname } = window.location; | |
| return pathname.endsWith("/") ? pathname : pathname + "/"; | |
| } | |