Add initial Code

This commit is contained in:
2025-10-20 08:57:51 +02:00
parent d204098d8e
commit 9da301c4f1
447 changed files with 34393 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
import axios from 'axios';
const api = axios.create({
baseURL: '/api',
headers: {
'Accept': 'application/json',
'X-Requested-With': 'XMLHttpRequest',
},
withCredentials: true, // Wichtig für Session-Cookies!
});
// Sanctum-Token aus localStorage hinzufügen (falls vorhanden)
const token = localStorage.getItem('sanctum_token');
if (token) {
api.defaults.headers.common['Authorization'] = `Bearer ${token}`;
}
export default api;