Webchat: clean server build and add ws types

This commit is contained in:
Peter Steinberger
2025-12-08 16:21:56 +00:00
parent 7144a0fb9b
commit a34ab1d36e
2 changed files with 2 additions and 2 deletions

View File

@@ -51,6 +51,7 @@
"devDependencies": {
"@biomejs/biome": "^2.3.8",
"@mariozechner/mini-lit": "0.2.1",
"@types/ws": "^8.5.12",
"@types/body-parser": "^1.19.6",
"@types/express": "^5.0.6",
"@types/node": "^24.10.1",

View File

@@ -405,7 +405,7 @@ export async function startWebChatServer(port = WEBCHAT_DEFAULT_PORT) {
return;
}
const sessionKey = url.searchParams.get("session") ?? "main";
wss!.handleUpgrade(req, socket, head, (ws) => {
wss!.handleUpgrade(req, socket, head, (ws: WebSocket) => {
ws.on("close", () => {
const set = wsSessions.get(sessionKey);
if (set) {
@@ -485,4 +485,3 @@ export async function ensureWebChatServerFromConfig() {
throw err;
}
}
*** End