text: async function signupFormHandler(event) {
    event.preventDefault();
  
    // Get the username, email and password
    const username = document.querySelector("#username-signup").value.trim();
    const email = document.querySelector("#email-signup").value.trim();
    const password = document.querySelector("#password-signup").value.trim();
  
    if (username && email && password) {
      const response = await fetch("/signup", {
      
        method: "post",
        body: JSON.stringify({
          username,
          email,
          password,
        }),
        headers: { "Content-Type": "application/json" },
      });
  
      if (response.ok) {
        document.location.replace("/login"); 
      } else {
        alert(response.statusText);
      }
    }
  }
  
  document
    .querySelector(".signup-form")
    .addEventListener("submit", signupFormHandler);
  