MCPcopy Create free account
hub / github.com/effect-app/libs / layer

Function layer

repos/effect/packages/effect/src/unstable/httpapi/HttpApiScalar.ts:218–235  ·  view source on GitHub ↗
(
  api: HttpApi.HttpApi<Id, Groups>,
  options?: {
    readonly path?: `/${string}` | undefined
    readonly scalar?: ScalarConfig
  } | undefined
)

Source from the content-addressed store, hash-verified

216 HttpRouter.use(Effect.fnUntraced(function*(router) {
217 const handler = makeHandler({
218 api,
219 source: {
220 _tag: "Inline",
221 source: internal.javascript
222 },
223 scalar: options?.scalar
224 })
225 yield* router.add("GET", options?.path ?? "/docs", handler)
226 }))
227
228/**
229 * Mounts a Scalar API reference page for an `HttpApi` that loads Scalar from jsDelivr.
230 *
231 * **Details**
232 *
233 * The route serves the OpenAPI specification generated from the API at the
234 * configured path, defaulting to `/docs`; `version` selects the Scalar package
235 * version loaded from the CDN.
236 *
237 * @category layers
238 * @since 4.0.0

Callers

nothing calls this directly

Calls 3

makeHandlerFunction · 0.70
useMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…