Message() {
      const message = messageInput.value.trim();

      if (message !== "") {
        addMessage(message, true);

        fetch("/api", {
          method: "POST",
          headers: {
            "Content-Type": "application/json"
          },
          body: JSON.stringify({ message })
        })
          .then(response => response.json())
          .then(data => {
                      messageInput.value = "";
            const messageDiv = document.createElement("div");
   