mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-23 10:45:33 -04:00
20 lines
643 B
TypeScript
20 lines
643 B
TypeScript
import { Effect } from "effect"
|
|
import { Service } from "@opencode-ai/client/effect/service"
|
|
import path from "node:path"
|
|
import { Standalone } from "../../src/services/standalone"
|
|
|
|
process.argv[1] = path.join(import.meta.dir, "../../src/index.ts")
|
|
|
|
await Effect.runPromise(
|
|
Effect.scoped(
|
|
Effect.gen(function* () {
|
|
const endpoint = yield* Standalone.start()
|
|
const response = yield* Effect.promise(() =>
|
|
fetch(new URL("/api/health", endpoint.url), { headers: Service.headers(endpoint) }),
|
|
)
|
|
console.log(`${endpoint.pid} ${endpoint.url} ${response.status}`)
|
|
return yield* Effect.never
|
|
}),
|
|
),
|
|
)
|