MCPcopy Index your code
hub / github.com/anomalyco/opencode / app

Function app

packages/opencode/test/server/httpapi-ui.test.ts:61–87  ·  view source on GitHub ↗
(input?: { password?: string; username?: string })

Source from the content-addressed store, hash-verified

59}
60
61function app(input?: { password?: string; username?: string }) {
62 const handler = HttpRouter.toWebHandler(
63 HttpApiApp.routes.pipe(
64 Layer.provide(
65 ConfigProvider.layer(
66 ConfigProvider.fromUnknown({
67 OPENCODE_SERVER_PASSWORD: input?.password,
68 OPENCODE_SERVER_USERNAME: input?.username,
69 }),
70 ),
71 ),
72 ),
73 { disableLogger: true },
74 ).handler
75 return {
76 request(input: string | URL | Request, init?: RequestInit) {
77 return Effect.promise(() =>
78 Promise.resolve(
79 handler(
80 input instanceof Request ? input : new Request(new URL(input, "http://localhost"), init),
81 HttpApiApp.context,
82 ),
83 ),
84 )
85 },
86 }
87}
88
89function uiApp(input?: {
90 password?: string

Callers 1

httpapi-ui.test.tsFile · 0.70

Calls 1

layerMethod · 0.45

Tested by

no test coverage detected