feat(gateway): allow webchat port override

This commit is contained in:
Peter Steinberger
2025-12-10 16:55:17 +00:00
parent e9fd73141d
commit 93a5784c58
4 changed files with 28 additions and 6 deletions

View File

@@ -160,10 +160,12 @@ export async function __broadcastGatewayEventForTests() {
// no-op
}
export async function ensureWebChatServerFromConfig() {
export async function ensureWebChatServerFromConfig(
overridePort?: number,
) {
const cfg = loadConfig();
if (cfg.webchat?.enabled === false) return null;
const port = cfg.webchat?.port ?? WEBCHAT_DEFAULT_PORT;
const port = overridePort ?? cfg.webchat?.port ?? WEBCHAT_DEFAULT_PORT;
try {
return await startWebChatServer(port);
} catch (err) {