fix port issue

This commit is contained in:
Dax Raad
2025-06-03 16:35:37 -04:00
parent 37c34fd39c
commit 1e063e7937
3 changed files with 6 additions and 3 deletions

View File

@@ -43,6 +43,10 @@ cli.command("", "Start the opencode in interactive mode").action(async () => {
stdout: "inherit",
stderr: "inherit",
stdin: "inherit",
env: {
...process.env,
OPENCODE_SERVER: server.url.toString(),
},
onExit: () => {
server.stop()
},

View File

@@ -13,7 +13,6 @@ import { Global } from "../global"
export namespace Server {
const log = Log.create({ service: "server" })
const PORT = 16713
export type Routes = ReturnType<typeof app>
@@ -401,7 +400,7 @@ export namespace Server {
export function listen() {
const server = Bun.serve({
port: PORT,
port: 0,
hostname: "0.0.0.0",
idleTimeout: 0,
fetch: app().fetch,