prepare websockets
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
import * as React from "bloatless-react";
|
||||
|
||||
document.querySelector("main")!.append(
|
||||
<h1>Hello there!</h1>
|
||||
);
|
||||
const ws = new WebSocket(`ws://${window.location.host}`);
|
||||
|
||||
ws.onopen = () => ws.send("Hello!")
|
||||
ws.onmessage = (data) => console.log(data);
|
||||
|
||||
document.querySelector("main")!.append(<h1>Hello there!</h1>);
|
||||
|
||||
Reference in New Issue
Block a user