fix #7267: adding base url to axios (#7267)

This commit is contained in:
Marco Dalalba 2025-03-24 10:25:52 -03:00 committed by GitHub
parent 0f143a43c9
commit 8b68d086f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,7 +1,8 @@
import axios from "axios";
export const openHands = axios.create();
export const openHands = axios.create({
baseURL: `${window.location.protocol}//${import.meta.env.VITE_BACKEND_BASE_URL || window?.location.host}`,
});
export const setAuthTokenHeader = (token: string) => {
openHands.defaults.headers.common.Authorization = `Bearer ${token}`;
};