mirror of
https://github.com/anomalyco/opencode.git
synced 2026-09-01 14:54:34 +00:00
19 lines
610 B
TypeScript
19 lines
610 B
TypeScript
import { Effect } from "effect"
|
|
import { HttpServer } from "effect/unstable/http"
|
|
import { ServerProcess } from "../../src/process"
|
|
|
|
export const startServer = Effect.fnUntraced(function* (directory: string) {
|
|
const server = yield* ServerProcess.start<never, never>({
|
|
hostname: "127.0.0.1",
|
|
port: 0,
|
|
password: "secret",
|
|
app: { version: "test-version" },
|
|
database: { path: ":memory:" },
|
|
config: { directory },
|
|
fs: { filewatcher: false },
|
|
})
|
|
return {
|
|
base: HttpServer.formatAddress(server.address),
|
|
headers: { authorization: `Basic ${btoa("opencode:secret")}` },
|
|
}
|
|
})
|