Skip to main content
GET
Project Settings

Get Project Settings

string
required
The unique identifier of the project (MongoDB ObjectId)

Authentication

Requires JWT authentication via the verifyJWT middleware.

Response

boolean
required
Indicates whether the request was successful
object
required
Project settings data

Example Request

Example Response


Update General Settings

Update project name, branch, and folder settings.

Path Parameters

string
required
The unique identifier of the project

Request Body

string
New project name (will be trimmed)
string
Git branch to deploy from (will be trimmed)
object
Subfolder configuration

Validation Rules

  • name must not be empty after trimming
  • repoBranchName will be trimmed if provided
  • If folder.enabled is true, folder.name is required and validated by the model
  • If folder.enabled is false, folder.name is set to empty string

Example Request

Example Response


Update Build Settings

Update build and deployment configuration.

Path Parameters

string
required
The unique identifier of the project

Request Body

string
Command to build the project. Can be empty string to clear.
string
Output directory for static sites. Can be empty string to clear.
string
Start command for Node.js projects. Can be empty string to clear.
number
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

string
required
The unique identifier of the project

Request Body

object
required
Key-value pairs of environment variables. All values must be strings.

Validation Rules

  • env must 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

Returned when:
  • Project with the specified ID doesn’t exist
  • Project doesn’t belong to the authenticated user
  • Project has been deleted
Returned when a server error occurs

Implementation Notes

General Settings Update

  • Uses findOneAndUpdate with runValidators: true and context: 'query'
  • Only updates fields that are provided in the request body
  • Folder name validation is enforced by the Mongoose schema
  • Returns updated name and settings fields only

Build Settings Update

  • Accepts undefined to 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