Spaces:
Sleeping
Sleeping
Download frontend/src/api.js from SubhojitGhimire/project-orb: direct link, hf CLI and curl.
- Browser
- Download file 478 Bytes
-
https://huggingface.co/spaces/SubhojitGhimire/project-orb/resolve/main/frontend/src/api.js
- Command line
-
hf download hf://spaces/SubhojitGhimire/project-orb/frontend/src/api.js
-
curl -L -o api.js https://huggingface.co/spaces/SubhojitGhimire/project-orb/resolve/main/frontend/src/api.js
478 Bytes
| // const API_BASE = import.meta.env.VITE_API_BASE || "http://localhost:8000"; | |
| const API_BASE = import.meta.env.VITE_API_BASE || ""; | |
| export async function getSkyData(lat, lon, time) { | |
| const res = await fetch(`${API_BASE}/api/sky`, { | |
| method: "POST", | |
| headers: { "Content-Type": "application/json" }, | |
| body: JSON.stringify({ | |
| latitude: lat, | |
| longitude: lon, | |
| time: time, | |
| }), | |
| }); | |
| if (!res.ok) throw new Error("API error"); | |
| return res.json(); | |
| } | |