Download client/src/lib/api.js from soxogvv/MNEMO: direct link, hf CLI and curl.
- Browser
- Download file 320 Bytes
-
https://huggingface.co/spaces/soxogvv/MNEMO/resolve/main/client/src/lib/api.js
- Command line
-
hf download hf://spaces/soxogvv/MNEMO/client/src/lib/api.js
-
curl -L -o api.js https://huggingface.co/spaces/soxogvv/MNEMO/resolve/main/client/src/lib/api.js
320 Bytes
| import axios from "axios"; | |
| import { STORAGE_KEYS } from "./storage"; | |
| export const api = axios.create({ | |
| baseURL: "/api" | |
| }); | |
| api.interceptors.request.use((config) => { | |
| const token = localStorage.getItem(STORAGE_KEYS.token); | |
| if (token) { | |
| config.headers.Authorization = `Bearer ${token}`; | |
| } | |
| return config; | |
| }); | |