MCPcopy Create free account
hub / github.com/pollinations/pollinations / attachWorkerDomain

Function attachWorkerDomain

apps/_scripts/deploy-app.js:308–331  ·  view source on GitHub ↗
(account, headers, hostname, zoneId)

Source from the content-addressed store, hash-verified

306}
307
308async function attachWorkerDomain(account, headers, hostname, zoneId) {
309 const { ok, json } = await cf(
310 `${CF_API}/accounts/${account}/workers/domains`,
311 headers,
312 {
313 method: "PUT",
314 body: JSON.stringify({
315 hostname,
316 service: PROXY_WORKER,
317 environment: "production",
318 override_existing_origin: true,
319 zone_id: zoneId,
320 }),
321 },
322 );
323
324 if (!ok) {
325 throw new Error(
326 `Attach proxy domain ${hostname} failed: ${JSON.stringify(json)}`,
327 );
328 }
329
330 console.log(`Proxy custom domain ready: ${hostname} -> ${PROXY_WORKER}`);
331}
332
333function appContext(appName) {
334 const config = JSON.parse(

Callers 1

runCutoverFunction · 0.85

Calls 3

stringifyMethod · 0.80
logMethod · 0.80
cfFunction · 0.70

Tested by

no test coverage detected