MCPcopy Create free account
hub / github.com/Effect-TS/effect / cors

Function cors

packages/effect/src/http/HttpRouter.ts:1338–1347  ·  view source on GitHub ↗
(
  options?: {
    readonly allowedOrigins?: ReadonlyArray<string> | undefined
    readonly allowedMethods?: ReadonlyArray<string> | undefined
    readonly allowedHeaders?: ReadonlyArray<string> | undefined
    readonly exposedHeaders?: ReadonlyArray<string> | undefined
    readonly maxAge?: number | undefined
    readonly credentials?: boolean | undefined
  } | undefined
)

Source from the content-addressed store, hash-verified

1336 * @since 4.0.0
1337 */
1338export const cors = (
1339 options?: {
1340 readonly allowedOrigins?: ReadonlyArray<string> | undefined
1341 readonly allowedMethods?: ReadonlyArray<string> | undefined
1342 readonly allowedHeaders?: ReadonlyArray<string> | undefined
1343 readonly exposedHeaders?: ReadonlyArray<string> | undefined
1344 readonly maxAge?: number | undefined
1345 readonly credentials?: boolean | undefined
1346 } | undefined
1347): Layer.Layer<never, never, HttpRouter> => middleware(HttpMiddleware.cors(options), { global: true })
1348
1349/**
1350 * Middleware that disables the logger for some routes.

Callers

nothing calls this directly

Calls 1

middlewareFunction · 0.70

Tested by

no test coverage detected