For the complete documentation index, see llms.txt. This page is also available as Markdown.

Update Node.js build settings

Replaces the build settings stored for the website.

Update Node.js build settings

put

Replaces the build settings stored for the website. Send the full set: node_version is required and every nullable field you omit is stored as null. Creates the settings when none exist yet.

This does not start a build. Stored settings drive Git auto-deployment builds; a build started through the API uses the values sent in that request, so to rebuild with corrected settings call Start Node.js build with the same values. Typical fixes: a wrong app_type after auto-detection, or a missing entry_file for express, fastify, nest, nuxt and hono apps.

Authorizations
AuthorizationstringRequired

API Token authentication

Path parameters
usernamestringRequiredExample: u123456789
domainstringRequired

Domain name

Example: mydomain.tld
Body
node_versioninteger · enumRequired

Node.js major version

Example: 20Possible values:
app_typestring · enum · nullableOptional

Node.js application framework. Set it explicitly when auto-detection picked the wrong one.

Example: vitePossible values:
root_directorystring · min: 1 · max: 200 · nullableOptional

Application root directory (where package.json is located) relative to public_html. Omit it, or send ".", for public_html itself.

Example: webapp
output_directorystring · min: 1 · max: 200 · nullableOptional

Build output directory relative to the root directory

Example: dist
build_scriptstring · min: 1 · max: 64 · nullableOptional

The package.json script that builds the application

Example: build
entry_filestring · min: 1 · max: 200 · nullableOptional

The main entry point file for the application (required for express, fastify, nest, nuxt and hono app types)

Example: server.js
package_managerstring · enum · min: 1 · max: 20 · nullableOptional

Package manager used to install dependencies

Example: npmPossible values:
Responses
200

Success response

application/json
node_versionintegerRequired

Node.js major version used to build and run the application

Example: 20
app_typestring · enum · nullableRequired

Detected or chosen application framework

Example: vitePossible values:
root_directorystring · nullableRequired

Application root directory (where package.json is located) relative to public_html; null means public_html itself

Example: frontend
output_directorystring · nullableRequired

Build output directory relative to the root directory

Example: dist
build_scriptstring · nullableRequired

The package.json script that builds the application

Example: build
entry_filestring · nullableRequired

The main entry point file for the application

Example: server.js
package_managerstring · enum · nullableRequired

Package manager used to install dependencies

Example: npmPossible values:
put/api/hosting/v1/accounts/{username}/websites/{domain}/nodejs/builds/settings
PUT /api/hosting/v1/accounts/{username}/websites/{domain}/nodejs/builds/settings HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 161

{
  "node_version": 20,
  "app_type": "vite",
  "root_directory": "webapp",
  "output_directory": "dist",
  "build_script": "build",
  "entry_file": "server.js",
  "package_manager": "npm"
}
{
  "node_version": 20,
  "app_type": "vite",
  "root_directory": "frontend",
  "output_directory": "dist",
  "build_script": "build",
  "entry_file": "server.js",
  "package_manager": "npm"
}

Last updated

Was this helpful?