MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / buildCors

Function buildCors

apps/api/src/config/security/security.ts:19–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17 * different host) set ALLOWED_ORIGINS and get a mounted middleware here.
18 */
19export const buildCors = () => {
20 if (env.ALLOWED_ORIGINS.length === 0) {
21 return undefined;
22 }
23
24 return cors({
25 origin: env.ALLOWED_ORIGINS,
26 credentials: true,
27 methods: CORS_METHODS,
28 allowedHeaders: CORS_ALLOWED_HEADERS,
29 exposeHeaders: CORS_EXPOSED_HEADERS,
30 maxAge: CORS_MAX_AGE_SECONDS,
31 aot: true,
32 });
33};
34
35/**
36 * Rate-limit storage picker. The default `elysia-rate-limit` context is

Callers 1

createAppFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected