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

Function cors

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

1153 */
1154 export type Fn = (
1155 effect: Effect.Effect<HttpServerResponse.HttpServerResponse>
1156 ) => Effect.Effect<HttpServerResponse.HttpServerResponse>
1157}
1158
1159/**
1160 * Middleware that applies CORS headers to the HTTP response.
1161 *
1162 * @category layers
1163 * @since 4.0.0
1164 */
1165export const cors = (
1166 options?: {
1167 readonly allowedOrigins?: ReadonlyArray<string> | undefined

Callers

nothing calls this directly

Calls 1

middlewareFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…