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

Function projectHasPagesDomain

apps/_scripts/deploy-app.js:171–183  ·  view source on GitHub ↗
(account, headers, project, customDomain)

Source from the content-addressed store, hash-verified

169}
170
171async function projectHasPagesDomain(account, headers, project, customDomain) {
172 const { ok, json } = await cf(
173 `${CF_API}/accounts/${account}/pages/projects/${project}/domains`,
174 headers,
175 );
176 if (!ok) {
177 throw new Error(
178 `List domains for ${project} failed: ${JSON.stringify(json)}`,
179 );
180 }
181
182 return json.result?.some((domain) => domain.name === customDomain);
183}
184
185async function addPagesDomain(account, headers, project, customDomain) {
186 if (await projectHasPagesDomain(account, headers, project, customDomain)) {

Callers 1

addPagesDomainFunction · 0.85

Calls 2

stringifyMethod · 0.80
cfFunction · 0.70

Tested by

no test coverage detected