feat(webchat): auto-start at root

This commit is contained in:
Peter Steinberger committed 2025-12-09 21:07:53 +00:00
1 parent 3ee3f7e30b
commit bd41cf377a
7 files changed
+43 -10

No files matched your search

+4 -2
View File
@@ -557,12 +557,14 @@ export function __broadcastGatewayEventForTests(
broadcastAll({ type: "gateway-event", event, payload });
}
export async function ensureWebChatServerFromConfig() {
export async function ensureWebChatServerFromConfig(opts?: {
gatewayUrl?: string;
}) {
const cfg = loadConfig();
if (cfg.webchat?.enabled === false) return null;
const port = cfg.webchat?.port ?? WEBCHAT_DEFAULT_PORT;
try {
return await startWebChatServer(port);
return await startWebChatServer(port, opts?.gatewayUrl);
} catch (err) {
logDebug(`webchat server failed to start: ${String(err)}`);
throw err;