summaryrefslogtreecommitdiff
path: root/server/web/index.gohtml
blob: bf603725164b9b2ace3f0e8d164da1d2daab1dbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>

<script>
    const start = async () => {
        const game = await fetch("/api/game/create")
        const gameId = await game.text()
        const connection = new WebSocket(`/api/game/${gameId}/connect`)
        connection.addEventListener("message", (ev) => {
            console.debug(JSON.parse(ev.data))
        })
    }
    start()
</script>
</body>
</html>