diff --git a/scripts/dev.ts b/scripts/dev.ts index 41295c0e7..93bce74f3 100644 --- a/scripts/dev.ts +++ b/scripts/dev.ts @@ -36,10 +36,10 @@ async function startDev() { const backendUrl = process.env.VITE_BACKEND_URL || getEnvVariable(viteEnvPath, "VITE_BACKEND_URL"); - const isUsingRemoteBackend = backendUrl?.includes("api.useautumn.com"); + const isUsingRemoteBackend = backendUrl?.includes(".useautumn.com"); if (isUsingRemoteBackend) { - console.log("\n🌐 Using remote backend (api.useautumn.com)"); + console.log("\n🌐 Using remote backend (*.useautumn.com)"); console.log("ā­ļø Skipping port cleanup...\n"); } else { // Port cleanup disabled (detection is unreliable) @@ -76,28 +76,26 @@ async function startDev() { ]; } - const concurrentlyProc = Bun.spawn(shellArgs, - { - cwd: projectRoot, - env: { - ...process.env, - VITE_PORT: VITE_PORT.toString(), - SERVER_PORT: SERVER_PORT.toString(), - }, - stdout: "inherit", - stderr: "inherit", - onExit(proc, exitCode, signalCode, error) { - if (error) { - console.error("Failed to start development servers:", error); - process.exit(1); - } - if (exitCode !== 0 && exitCode !== null) { - console.error(`Development servers exited with code ${exitCode}`); - } - process.exit(exitCode ?? 0); - }, + const concurrentlyProc = Bun.spawn(shellArgs, { + cwd: projectRoot, + env: { + ...process.env, + VITE_PORT: VITE_PORT.toString(), + SERVER_PORT: SERVER_PORT.toString(), }, - ); + stdout: "inherit", + stderr: "inherit", + onExit(proc, exitCode, signalCode, error) { + if (error) { + console.error("Failed to start development servers:", error); + process.exit(1); + } + if (exitCode !== 0 && exitCode !== null) { + console.error(`Development servers exited with code ${exitCode}`); + } + process.exit(exitCode ?? 0); + }, + }); // Handle termination signals process.on("SIGINT", () => { diff --git a/server/src/init.ts b/server/src/init.ts index 140168710..ec60774fa 100644 --- a/server/src/init.ts +++ b/server/src/init.ts @@ -45,6 +45,7 @@ const init = async () => { "http://localhost:5174", "https://app.useautumn.com", "https://staging.useautumn.com", + "https://dev.useautumn.com", "https://api.staging.useautumn.com", "https://localhost:8080", "https://www.alphalog.ai", diff --git a/server/src/initHono.ts b/server/src/initHono.ts index 4bb1e4773..1a5005e0c 100644 --- a/server/src/initHono.ts +++ b/server/src/initHono.ts @@ -19,6 +19,7 @@ const ALLOWED_ORIGINS = [ "http://localhost:5174", "https://app.useautumn.com", "https://staging.useautumn.com", + "https://dev.useautumn.com", "https://api.staging.useautumn.com", "https://localhost:8080", ];