Skip to content

Commit ced76fa

Browse files
committed
chore: update playground
1 parent 4e82c55 commit ced76fa

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

examples/h3/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createApp, createRouter } from "h3";
1+
import { createApp } from "h3";
22
import { defineWebSocketHooks } from "crossws";
33

44
export const app = createApp();

examples/h3/public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ <h3>WebSocket Test Page</h3>
3939
<br />
4040
</div>
4141

42-
<div id="logs"></div>
42+
<pre id="logs"></pre>
4343

4444
<script type="module">
4545
const url = "ws://" + location.host + "/_ws";

playground/_shared.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ import {
44
defineWebSocketHooks,
55
} from "../src/index.ts";
66

7-
export const getIndexHTML = (params) =>
8-
import("../examples/h3/index.html.ts").then((r) => r.html(params));
7+
export const getIndexHTML = () =>
8+
fetch(
9+
"https://raw.githubusercontent.com/unjs/crossws/main/examples/h3/public/index.html",
10+
).then((res) => res.text());
911

1012
export function createDemo<T extends WebSocketAdapter>(
1113
adapter: T,

playground/node.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const adapter = createDemo(nodeAdapter);
88

99
const server = createServer(async (req, res) => {
1010
res.writeHead(200, { "Content-Type": "text/html" });
11-
res.end(await getIndexHTML({ name: "node-ws" }));
11+
res.end(await getIndexHTML());
1212
});
1313

1414
server.on("upgrade", adapter.handleUpgrade);

0 commit comments

Comments
 (0)