ui/server/src/newProjectApi
(part of ) -- "New project": one name in, an initialised project in the caller's workspace out.
Cockpit server, next. Source: ui/server/src/newProjectApi.mjs.
Variables#
NEW_PROJECT_FRAMEWORKS#
constNEW_PROJECT_FRAMEWORKS: readonlystring[]
Defined in: ui/server/src/newProjectApi.mjs:22
Functions#
createNewProjectRouter()#
createNewProjectRouter(
deps):any
Defined in: ui/server/src/newProjectApi.mjs:73
Parameters#
deps
runInit is the in-process construct init (captured); openProject makes dir the current project and returns
the settings body the client renders (index.mjs passes the same closure POST /api/settings uses).
clientOrigin?
string
openProject
(dir) => any
runInit
(dir, framework) => Promise<{ error?: string; ok: boolean; output?: string[]; }>
Returns#
any
planNewProject()#
planNewProject(
body): {dir:string;framework:string;name:string;ok:true; } | {body:any;ok:false;status:number; }
Defined in: ui/server/src/newProjectApi.mjs:31
Validate the request and return the folder to create, or a refusal. Pure of side effects: nothing is written.
Parameters#
body
unknown
Returns#
{ dir: string; framework: string; name: string; ok: true; } | { body: any; ok: false; status: number; }