aki-008
fix: replace localhost with relative paths for deployment
bcebe14
raw
history blame contribute delete
337 Bytes
import axios from "axios";
const API = axios.create({
baseURL: "/api/v1",
});
// Attach token automatically for every request
API.interceptors.request.use((config) => {
const token = localStorage.getItem("token");
if (token) {
config.headers.Authorization = `Bearer ${token}`;
}
return config;
});
export default API;