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

Function cors

packages/effect/src/unstable/http/HttpRouter.ts:1156–1165  ·  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

1154 * @since 4.0.0
1155 */
1156export const cors = (
1157 options?: {
1158 readonly allowedOrigins?: ReadonlyArray<string> | undefined
1159 readonly allowedMethods?: ReadonlyArray<string> | undefined
1160 readonly allowedHeaders?: ReadonlyArray<string> | undefined
1161 readonly exposedHeaders?: ReadonlyArray<string> | undefined
1162 readonly maxAge?: number | undefined
1163 readonly credentials?: boolean | undefined
1164 } | undefined
1165): Layer.Layer<never, never, HttpRouter> => middleware(HttpMiddleware.cors(options), { global: true })
1166
1167/**
1168 * Middleware that disables the logger for some routes.

Callers

nothing calls this directly

Calls 1

middlewareFunction · 0.70

Tested by

no test coverage detected