async function ask() {
  const message = document.getElementById('msg').value;
  const res = await fetch('/api/chat', {
    method: 'POST',
    headers: {'Content-Type': 'application/json'},
    body: JSON.stringify({message: message})
  });
  const data = await res.json();
  document.getElementById('answer').innerText = data.answer;
}
