Skip to content

Commit af3a61f

Browse files
committed
Add host/port override to control server
1 parent 9ded048 commit af3a61f

File tree

1 file changed

+7
-3
lines changed
  • packages/streamwall-control-server/src

1 file changed

+7
-3
lines changed

packages/streamwall-control-server/src/index.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,12 +458,14 @@ async function initialInviteCodes({
458458
}
459459

460460
export default async function runServer({
461+
port: overridePort,
462+
hostname: overrideHostname,
461463
baseURL,
462464
clientStaticPath,
463-
}: AppOptions) {
465+
}: AppOptions & { hostname?: string; port?: string }) {
464466
const url = new URL(baseURL)
465-
const { hostname } = url
466-
const port = url.port !== '' ? Number(url.port) : 80
467+
const hostname = overrideHostname ?? url.hostname
468+
const port = Number(overridePort ?? url.port ?? '80')
467469

468470
console.debug('Initializing web server:', { hostname, port })
469471
const { app, db, auth } = await initApp({
@@ -479,6 +481,8 @@ export default async function runServer({
479481
}
480482

481483
runServer({
484+
hostname: process.env.STREAMWALL_CONTROL_HOSTNAME,
485+
port: process.env.STREAMWALL_CONTROL_PORT,
482486
baseURL: process.env.STREAMWALL_CONTROL_URL ?? 'http://localhost:3000',
483487
clientStaticPath:
484488
process.env.STREAMWALL_CONTROL_STATIC ??

0 commit comments

Comments
 (0)