Spaces:
Sleeping
Sleeping
Download frontend/src/lib/api.js from Gaurav711/NeuroScope: direct link, hf CLI and curl.
- Browser
- Download file 1.5 kB
-
https://huggingface.co/spaces/Gaurav711/NeuroScope/resolve/main/frontend/src/lib/api.js
- Command line
-
hf download hf://spaces/Gaurav711/NeuroScope/frontend/src/lib/api.js
-
curl -L -o api.js https://huggingface.co/spaces/Gaurav711/NeuroScope/resolve/main/frontend/src/lib/api.js
1.5 kB
| import axios from "axios"; | |
| export const BACKEND_URL = process.env.REACT_APP_BACKEND_URL; | |
| export const API = `${BACKEND_URL}/api/v1`; | |
| const client = axios.create({ | |
| baseURL: API, | |
| timeout: 120000, | |
| }); | |
| export const api = { | |
| health: () => client.get("/health").then((r) => r.data), | |
| suggestedTasks: () => client.get("/suggested-tasks").then((r) => r.data), | |
| listRuns: () => client.get("/runs").then((r) => r.data), | |
| createRun: (body) => client.post("/runs", body).then((r) => r.data), | |
| getRun: (id) => client.get(`/runs/${id}`).then((r) => r.data), | |
| getStep: (id, n) => client.get(`/runs/${id}/steps/${n}`).then((r) => r.data), | |
| patch: (id, body) => | |
| client.post(`/runs/${id}/patch`, body).then((r) => r.data), | |
| patchMatrix: (id, body) => | |
| client.post(`/runs/${id}/patch-matrix`, body).then((r) => r.data), | |
| listPatches: (id) => client.get(`/runs/${id}/patches`).then((r) => r.data), | |
| attribution: (id, body) => | |
| client.post(`/runs/${id}/attribution`, body).then((r) => r.data), | |
| query: (id, body) => | |
| client.post(`/runs/${id}/query`, body).then((r) => r.data), | |
| listQueries: (id) => client.get(`/runs/${id}/queries`).then((r) => r.data), | |
| listExperiments: () => client.get("/experiments").then((r) => r.data), | |
| getExperiment: (slug) => | |
| client.get(`/experiments/${slug}`).then((r) => r.data), | |
| getFeature: (layer, fid) => | |
| client.get(`/feature/${layer}/${fid}`).then((r) => r.data), | |
| }; | |
| export default api; | |