added opencode serve command

This commit is contained in:
Dax Raad
2025-06-24 20:52:09 -04:00
parent 9d7cfda9fe
commit 4b26b43855
3 changed files with 61 additions and 6 deletions

View File

@@ -579,10 +579,10 @@ export namespace Server {
return result
}
export function listen() {
export function listen(opts: { port: number; hostname: string }) {
const server = Bun.serve({
port: 0,
hostname: "0.0.0.0",
port: opts.port,
hostname: opts.hostname,
idleTimeout: 0,
fetch: app().fetch,
})