room_info.js 378 B

12345678910
  1. // fetch room details and display join info
  2. fetch("/api/room/details")
  3. .then((response) => response.json())
  4. .then((data) => {
  5. const joinInfoSpan = document.getElementById("join-info");
  6. joinInfoSpan.innerHTML = `other people can join at http://${data.serverIP}:${data.port}`;
  7. })
  8. .catch((error) => {
  9. console.error("Error fetching room details:", error);
  10. });