diff --git a/src/server/apps.ts b/src/server/apps.ts index 2744842..191386e 100644 --- a/src/server/apps.ts +++ b/src/server/apps.ts @@ -8,6 +8,7 @@ import { appLog, hostLog, setApps } from './tui' export type { AppState } from '@types' export const APPS_DIR = process.env.APPS_DIR ?? resolve(join(process.env.DATA_DIR ?? '.', 'apps')) +export const TOES_URL = process.env.TOES_URL ?? `http://localhost:${process.env.PORT || 3000}` const HEALTH_CHECK_FAILURES_BEFORE_RESTART = 3 const HEALTH_CHECK_INTERVAL = 30000 @@ -438,7 +439,7 @@ async function runApp(dir: string, port: number) { const proc = Bun.spawn(['bun', 'run', 'toes'], { cwd, - env: { ...process.env, PORT: String(port), NO_AUTOPORT: 'true', APPS_DIR, TOES_URL: `http://localhost:${process.env.PORT || 3000}` }, + env: { ...process.env, PORT: String(port), NO_AUTOPORT: 'true', APPS_DIR, TOES_URL }, stdout: 'pipe', stderr: 'pipe', })