Project Settings
Projects
Project Settings
Retrieve and update project configuration settings
GET
Project Settings
Get Project Settings
The unique identifier of the project (MongoDB ObjectId)
Authentication
Requires JWT authentication via theverifyJWT middleware.
Response
Indicates whether the request was successful
Project settings data
Example Request
Example Response
Update General Settings
Update project name, branch, and folder settings.Path Parameters
The unique identifier of the project
Request Body
New project name (will be trimmed)
Git branch to deploy from (will be trimmed)
Subfolder configuration
Validation Rules
namemust not be empty after trimmingrepoBranchNamewill be trimmed if provided- If
folder.enabledis true,folder.nameis required and validated by the model - If
folder.enabledis false,folder.nameis set to empty string
Example Request
Example Response
Update Build Settings
Update build and deployment configuration.Path Parameters
The unique identifier of the project
Request Body
Command to build the project. Can be empty string to clear.
Output directory for static sites. Can be empty string to clear.
Start command for Node.js projects. Can be empty string to clear.
Port number for Node.js projects. Set to null/undefined to clear.
Example Request (Static Site)
Example Request (Node.js App)
Example Response
Update Environment Variables
Update project environment variables. This replaces all existing environment variables.Path Parameters
The unique identifier of the project
Request Body
Key-value pairs of environment variables. All values must be strings.
Validation Rules
envmust be a plain object (not an array)- Environment variable keys cannot be empty or whitespace-only
- All keys are trimmed and validated
- Passing an empty object
{}will clear all environment variables
Example Request
Example Response
Error Response (Invalid Key)
Error Response (Invalid Type)
Common Error Responses
404 Not Found
Returned when:
- Project with the specified ID doesn’t exist
- Project doesn’t belong to the authenticated user
- Project has been deleted
500 Internal Server Error
Returned when a server error occurs
Implementation Notes
General Settings Update
- Uses
findOneAndUpdatewithrunValidators: trueandcontext: 'query' - Only updates fields that are provided in the request body
- Folder name validation is enforced by the Mongoose schema
- Returns updated
nameandsettingsfields only
Build Settings Update
- Accepts
undefinedto skip updating a field - Port is parsed as integer if provided
- Returns only the updated build-related fields
Environment Variables Update
- Stores environment variables as a MongoDB Map internally
- Completely replaces existing environment variables
- Keys are validated to prevent empty strings
- Does not return the environment variables in the response (for security)
Source Reference
- GET:
backend/src/controllers/slices/Project/settings.js:4 - PATCH general:
backend/src/controllers/slices/Project/settings.js:36 - PATCH build:
backend/src/controllers/slices/Project/settings.js:70 - PATCH env:
backend/src/controllers/slices/Project/settings.js:96