Skip to content

Commit

Permalink
FREEZE.unindexed
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarron committed Dec 7, 2024
1 parent c3b0a2a commit 1d36b38
Show file tree
Hide file tree
Showing 8 changed files with 477 additions and 441 deletions.
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"scramble": "./dist/bin/scramble.js"
},
"dependencies": {
"@types/bun": "^1.1.14",
"@types/three": "^0.169.0",
"@types/web-bluetooth": "^0.0.20",
"cmd-ts-too": "^0.15.3",
Expand Down
6 changes: 5 additions & 1 deletion script/build/sites/dev.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import { serveHeadToHead } from "../../../src/server/head-to-head/main";
import { barelyServeSite } from "./barelyServeSite";

await barelyServeSite("sites", /* dev */ true);
await Promise.all([
barelyServeSite("sites", /* dev */ true),
serveHeadToHead(),
]);
28 changes: 18 additions & 10 deletions src/server/head-to-head/main.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
Bun.serve({
fetch(req, server) {
// upgrade the request to a WebSocket
if (server.upgrade(req)) {
return; // do not return a Response
}
return new Response("Upgrade failed", { status: 500 });
},
websocket: {}, // handlers
});
import { serve } from "bun";

export async function serveHeadToHead() {
return serve({
port: 3456,
fetch(req, server) {
// upgrade the request to a WebSocket
if (server.upgrade(req)) {
return; // do not return a Response
}
},
websocket: {
message(ws, message) {
console.log(message);
},
},
});
}
9 changes: 9 additions & 0 deletions src/server/head-to-head/unbundled-types.tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"noEmit": true,
"skipLibCheck": true,
"types": ["bun"]
},
"include": ["src/cubing", "node_modules/@types/node"]
}
Loading

0 comments on commit 1d36b38

Please sign in to comment.