<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title>Flask教學</title>
  </head>
  <body>
    {% extends "template.html" %}
    {% block content %}
    <h1> 我的第一個Flask網站</h1>
    <p> Flask是一個使用Python編寫的輕量級Web應用框架。Here's home.html </p>
    {% endblock %}
  </body>
  <script>
    let ws = new WebSocket("ws://localhost:4000")
    ws.onopen = () => {
      console.log("open connection")
    }
    ws.onclose = () => {
      console.log("close connection")
    }
    ws.onmessage = (e) => {
      alert("OK")
      console.log(e.data)
    }
  </script>
</html>