literally every time
All checks were successful
Build and Deploy Frontend / build-and-deploy (push) Successful in 6s
All checks were successful
Build and Deploy Frontend / build-and-deploy (push) Successful in 6s
This commit is contained in:
24
client/src/api/axios.ts
Normal file
24
client/src/api/axios.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
// http service hub
|
||||
// handles interceptors and such
|
||||
|
||||
import axios from "axios";
|
||||
|
||||
const baseUrl: string = import.meta.env.DEV ? import.meta.env.VITE_DEV_API_URL : "https://app.vxbard.net/api"
|
||||
const api = axios.create({
|
||||
baseURL: baseUrl
|
||||
});
|
||||
|
||||
api.interceptors.request.use(config => {
|
||||
|
||||
const token = localStorage.getItem("token");
|
||||
|
||||
if (token) {
|
||||
config.headers.Authorization = `Bearer ${token}`;
|
||||
}
|
||||
|
||||
return config;
|
||||
|
||||
});
|
||||
|
||||
export default api;
|
||||
Reference in New Issue
Block a user