Update Node.js build settings
Replaces the build settings stored for the website.
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.
API Token authentication
u123456789Domain name
mydomain.tldNode.js major version
20Possible values: Node.js application framework. Set it explicitly when auto-detection picked the wrong one.
vitePossible values: Application root directory (where package.json is located) relative to public_html. Omit it, or send ".", for public_html itself.
webappBuild output directory relative to the root directory
distThe package.json script that builds the application
buildThe main entry point file for the application (required for express, fastify, nest, nuxt and hono app types)
server.jsPackage manager used to install dependencies
npmPossible values: Success response
Node.js major version used to build and run the application
20Detected or chosen application framework
vitePossible values: Application root directory (where package.json is located) relative to public_html; null means public_html itself
frontendBuild output directory relative to the root directory
distThe package.json script that builds the application
buildThe main entry point file for the application
server.jsPackage manager used to install dependencies
npmPossible values: Unauthenticated response
Validation error response
Error response
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?