MCPcopy Create free account
hub / github.com/formkit/formkit / createProject

Function createProject

packages/cli/src/createApp.ts:71–100  ·  view source on GitHub ↗
(token: string, team: number)

Source from the content-addressed store, hash-verified

69}
70
71async function createProject(token: string, team: number) {
72 const res = await prompts({
73 type: 'text',
74 name: 'name',
75 message: 'Please enter a new project name:',
76 initial: 'My new project',
77 })
78 const response = await fetch(`${APP_URL}/api/teams/${team}/projects`, {
79 method: 'POST',
80 headers: {
81 Authorization: `Bearer ${token}`,
82 'Content-Type': 'application/json',
83 Accept: 'application/json',
84 },
85 body: JSON.stringify({
86 name: res.name,
87 license: 'development',
88 }),
89 })
90 if (!response.ok) {
91 error('Failed to create project.')
92 }
93 const data = await response.json()
94 if (data.data) {
95 info(
96 `Your project was created successfully with a development license — to upgrade to a production license visit ${APP_URL}`
97 )
98 }
99 return data.data
100}
101
102async function selectProProject() {
103 try {

Callers 1

selectProProjectFunction · 0.85

Calls 2

errorFunction · 0.90
infoFunction · 0.90

Tested by

no test coverage detected