umbennen von frontend zu frontend
This commit is contained in:
1 parent
6530638141
commit
5424351cea
22 files changed
+50
-2
No files matched your search
@@ -0,0 +1,13 @@
|
||||
import axios from 'axios';
|
||||
|
||||
const instance = axios.create({
|
||||
baseURL: import.meta.env.VITE_API_URL || 'http://localhost:5000/api',
|
||||
});
|
||||
|
||||
instance.interceptors.request.use(config => {
|
||||
const token = localStorage.getItem('token');
|
||||
if (token) config.headers.Authorization = `Bearer ${token}`;
|
||||
return config;
|
||||
});
|
||||
|
||||
export default instance;
|
||||
Reference in new issue
Block a user