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

Function createPagesProject

apps/_scripts/deploy-app.js:75–100  ·  view source on GitHub ↗
(account, headers, project, appConfig)

Source from the content-addressed store, hash-verified

73}
74
75async function createPagesProject(account, headers, project, appConfig) {
76 const { ok, json } = await cf(
77 `${CF_API}/accounts/${account}/pages/projects`,
78 headers,
79 {
80 method: "POST",
81 body: JSON.stringify({
82 name: project,
83 production_branch: "production",
84 build_config: {
85 build_command: appConfig.buildCommand || "",
86 destination_dir: appConfig.outputDir || ".",
87 },
88 }),
89 },
90 );
91
92 if (ok || hasCode(json, 8000002)) {
93 console.log(`Pages project ready: ${project}`);
94 return;
95 }
96
97 throw new Error(
98 `Create project ${project} failed: ${JSON.stringify(json)}`,
99 );
100}
101
102async function getPagesProject(account, headers, project) {
103 const { ok, json } = await cf(

Callers 1

runOriginFunction · 0.85

Calls 4

hasCodeFunction · 0.85
stringifyMethod · 0.80
logMethod · 0.80
cfFunction · 0.70

Tested by

no test coverage detected