let socket = io.connect();
/*
Front-end Event
*/
// Disconnect
document.getElementById("logout").addEventListener("click", function() {
socket.emit("logout")
});
Socket Actions
socket.on("logout", data=>{
if(data.error){
alert(data.error.message);
}else{
window.location.href = "/";
}
function profilRedirect(){
document.location.href="/profil";