Spaces:
Sleeping
Sleeping
Download frontend/src/api.js from elya5/ojs-dashboard: direct link, hf CLI and curl.
- Browser
- Download file 244 Bytes
-
https://huggingface.co/spaces/elya5/ojs-dashboard/resolve/main/frontend/src/api.js
- Command line
-
hf download hf://spaces/elya5/ojs-dashboard/frontend/src/api.js
-
curl -L -o api.js https://huggingface.co/spaces/elya5/ojs-dashboard/resolve/main/frontend/src/api.js
244 Bytes
| const API_BASE = import.meta.env.VITE_API_BASE ?? '' | |
| export async function apiGet (path) { | |
| const res = await fetch(API_BASE + path) | |
| if (!res.ok) { | |
| throw new Error(`API error ${res.status}: ${res.statusText}`) | |
| } | |
| return res.json() | |
| } | |