MCPcopy Create free account
hub / github.com/cloudflare/wildebeest / handleRequest

Function handleRequest

functions/api/v2/instance.ts:13–41  ·  view source on GitHub ↗
(domain: string, db: Database, env: Env)

Source from the content-addressed store, hash-verified

11}
12
13export async function handleRequest(domain: string, db: Database, env: Env) {
14 const headers = {
15 ...cors(),
16 'content-type': 'application/json; charset=utf-8',
17 }
18
19 const res: InstanceConfigV2 = {
20 domain,
21 title: env.INSTANCE_TITLE,
22 version: getVersion(),
23 source_url: 'https://github.com/cloudflare/wildebeest',
24 description: env.INSTANCE_DESCR,
25 thumbnail: {
26 url: DEFAULT_THUMBNAIL,
27 },
28 languages: ['en'],
29 registrations: {
30 // Registration is disabled because unsupported by Wildebeest. Users
31 // should go through the login flow and authenticate with Access.
32 enabled: false,
33 },
34 contact: {
35 email: env.ADMIN_EMAIL,
36 },
37 rules: [],
38 }
39
40 return new Response(JSON.stringify(res), { headers })
41}

Callers 1

onRequestFunction · 0.70

Calls 2

corsFunction · 0.90
getVersionFunction · 0.90

Tested by

no test coverage detected