From 231de3060633108fb8cdc857c3eb603c9733ed6b Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Tue, 2 Jun 2026 22:57:42 -0700 Subject: [PATCH] feat(relay): expose Scalar API docs Co-authored-by: codex --- infra/relay/src/worker.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/infra/relay/src/worker.ts b/infra/relay/src/worker.ts index 43aa0ab457..76e561241c 100644 --- a/infra/relay/src/worker.ts +++ b/infra/relay/src/worker.ts @@ -10,6 +10,7 @@ import * as Etag from "effect/unstable/http/Etag"; import * as HttpPlatform from "effect/unstable/http/HttpPlatform"; import * as HttpRouter from "effect/unstable/http/HttpRouter"; import * as HttpApiBuilder from "effect/unstable/httpapi/HttpApiBuilder"; +import * as HttpApiScalar from "effect/unstable/httpapi/HttpApiScalar"; import { RelayApi } from "@t3tools/contracts/relay"; @@ -248,10 +249,12 @@ export default class Api extends Cloudflare.Worker()( ); const fetch = Layer.merge( - HttpApiBuilder.layer(RelayApi).pipe( - Layer.provide(appLayer), - Layer.provide([Etag.layerWeak, httpPlatformNotSupportedLayer, relayCors]), - ), + Layer.mergeAll( + HttpApiBuilder.layer(RelayApi, { openapiPath: "/openapi.json" }).pipe( + Layer.provide(appLayer), + ), + HttpApiScalar.layer(RelayApi, { path: "/docs" }), + ).pipe(Layer.provide([Etag.layerWeak, httpPlatformNotSupportedLayer, relayCors])), relayNotFoundRoute, ).pipe( HttpRouter.toHttpEffect,