Download src/api.ts from TwanAPI/123: direct link, hf CLI and curl.
- Browser
- Download file 297 Bytes
-
https://huggingface.co/spaces/TwanAPI/123/resolve/main/src/api.ts
- Command line
-
hf download hf://spaces/TwanAPI/123/src/api.ts
-
curl -L -o api.ts https://huggingface.co/spaces/TwanAPI/123/resolve/main/src/api.ts
297 Bytes
| import axios from "axios"; | |
| const api = axios.create({ | |
| baseURL: "http://localhost:3000", | |
| }); | |
| api.interceptors.request.use((config) => { | |
| const token = localStorage.getItem("accessToken"); | |
| if (token) config.headers.Authorization = `Bearer ${token}`; | |
| return config; | |
| }); | |
| export default api; | |