refactor(server): simplify listener lifecycle (#27413)
This commit is contained in:
@@ -49,7 +49,7 @@ function app(modules: Runtime, options: CallOptions) {
|
||||
if (appCache[cacheKey]) return appCache[cacheKey]
|
||||
|
||||
const handler = HttpRouter.toWebHandler(
|
||||
modules.ExperimentalHttpApiServer.routes.pipe(
|
||||
modules.HttpApiApp.routes.pipe(
|
||||
Layer.provide(
|
||||
ConfigProvider.layer(
|
||||
ConfigProvider.fromUnknown({ OPENCODE_SERVER_PASSWORD: password, OPENCODE_SERVER_USERNAME: username }),
|
||||
@@ -62,7 +62,7 @@ function app(modules: Runtime, options: CallOptions) {
|
||||
request(input: string | URL | Request, init?: RequestInit) {
|
||||
return handler(
|
||||
input instanceof Request ? input : new Request(new URL(input, "http://localhost"), init),
|
||||
modules.ExperimentalHttpApiServer.context,
|
||||
modules.HttpApiApp.context,
|
||||
)
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user