(
api: HttpApi.HttpApi<Id, Groups>,
options?: {
readonly path?: `/${string}` | undefined
readonly scalar?: ScalarConfig
readonly version?: string | undefined
} | undefined
)
| 238 | * @since 4.0.0 |
| 239 | */ |
| 240 | export const layerCdn = <Id extends string, Groups extends HttpApiGroup.Constraint>( |
| 241 | api: HttpApi.HttpApi<Id, Groups>, |
| 242 | options?: { |
| 243 | readonly path?: `/${string}` | undefined |
| 244 | readonly scalar?: ScalarConfig |
| 245 | readonly version?: string | undefined |
| 246 | } | undefined |
| 247 | ): Layer.Layer<never, never, HttpRouter.HttpRouter> => |
| 248 | HttpRouter.use(Effect.fnUntraced(function*(router) { |
| 249 | const handler = makeHandler({ |
| 250 | api, |
| 251 | source: { |
| 252 | _tag: "Cdn", |
| 253 | version: options?.version |
| 254 | }, |
| 255 | scalar: options?.scalar |
| 256 | }) |
| 257 | yield* router.add("GET", options?.path ?? "/docs", handler) |
| 258 | })) |
nothing calls this directly
no test coverage detected