Version 1.0.0 - Initialisation du depot

This commit is contained in:
2025-07-25 18:00:14 +02:00
commit e3d7a911f4
51 changed files with 4335 additions and 0 deletions

22
src/socket.js Normal file
View File

@@ -0,0 +1,22 @@
import { io } from "socket.io-client";
var URL = null
await fetch("/information.json").then(response => response.json())
.then(data => {
if (import.meta.env.DEV) {
URL = data.backend.development;
} else {
URL = data.backend.production;
}
}).catch(error => {
console.error("Erreur lors de la récupération de l'URL du backend :", error);
});
export const socket = io(URL, {
autoConnect: false,
reconnectionAttempts: 0,
auth: {
token: localStorage.getItem("token") || null,
sessionId: localStorage.getItem("session") || null
},
});