(
api: HttpApi.HttpApi<Id, Groups>,
options?: {
readonly path?: `/${string}` | undefined
readonly scalar?: ScalarConfig
} | undefined
)
| 207 | * @since 4.0.0 |
| 208 | */ |
| 209 | export const layer = <Id extends string, Groups extends HttpApiGroup.Constraint>( |
| 210 | api: HttpApi.HttpApi<Id, Groups>, |
| 211 | options?: { |
| 212 | readonly path?: `/${string}` | undefined |
| 213 | readonly scalar?: ScalarConfig |
| 214 | } | undefined |
| 215 | ): Layer.Layer<never, never, HttpRouter.HttpRouter> => |
| 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. |
nothing calls this directly
no test coverage detected