MNEMO / client /src /lib /api.js
SyntaxAdi
style: fix image rendering and refine AnswerRenderer logic
bcf42ee
Raw
History Blame Contribute Delete
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;
});