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

Get Node.js build settings from repository

Determine the build settings for a Node.js application from the package.json file of a branch in a Git repository.

Get Node.js build settings from repository

get

Determine the build settings for a Node.js application from the package.json file of a branch in a Git repository. Use before starting a Git-source build to find out the auto-detected settings instead of guessing them.

The repository is read through a Git installation: take installation_uuid from List Git installations and owner and repository from List Git installation repositories.

Returns 422 when the installation is not found, the repository or branch is not found, or the branch has no package.json.

Authorizations
AuthorizationstringRequired

API Token authentication

Path parameters
usernamestringRequiredExample: u123456789
domainstringRequired

Domain name

Example: mydomain.tld
Query parameters
ownerstring · min: 1 · max: 200Required

Repository owner login. GitLab group paths use slashes.

Example: octocatPattern: ^[a-zA-Z0-9_]([a-zA-Z0-9_.-]{0,198}[a-zA-Z0-9_])?(\/[a-zA-Z0-9_]([a-zA-Z0-9_.-]{0,198}[a-zA-Z0-9_])?)*$
repositorystring · min: 1 · max: 100Required

Repository name without the .git suffix

Example: my-sitePattern: ^[a-zA-Z0-9_-]([a-zA-Z0-9._-]{0,98}[a-zA-Z0-9_-])?$
branchstring · min: 1 · max: 200Required

Branch whose package.json is inspected

Example: mainPattern: ^[a-zA-Z0-9._-]([a-zA-Z0-9\/._-]{0,198}[a-zA-Z0-9._-])?$
installation_uuidstring · uuidRequired

Git installation used to access the repository, taken from List Git installations

Example: 018f5e2a-1234-7890-abcd-1234567890ab
Responses
200

Success response

application/json
app_typestring · enum · nullableRequired

Node.js application type

Example: create-react-appPossible values:
node_versioninteger · nullableRequired

Node.js version

Example: 18
root_directorystring · nullableRequired

Application root directory

Example: frontend
output_directorystring · nullableRequired

Build output directory

Example: dist
build_scriptstring · nullableRequired

The npm script to run to build the application

Example: build
entry_filestring · nullableRequired

The main entry point file for the application

Example: server.js
package_managerstring · enum · nullableRequired

Package manager

Example: npmPossible values:
available_scriptsstring[]Required

The scripts configured in the package.json file

Example: ["build","test"]
get/api/hosting/v1/accounts/{username}/websites/{domain}/nodejs/builds/settings/from-repository
GET /api/hosting/v1/accounts/{username}/websites/{domain}/nodejs/builds/settings/from-repository?owner=text&repository=text&branch=text&installation_uuid=123e4567-e89b-12d3-a456-426614174000 HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "app_type": "create-react-app",
  "node_version": 18,
  "root_directory": "frontend",
  "output_directory": "dist",
  "build_script": "build",
  "entry_file": "server.js",
  "package_manager": "npm",
  "available_scripts": [
    "build",
    "test"
  ]
}

Last updated

Was this helpful?