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.
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.
API Token authentication
u123456789Domain name
mydomain.tldRepository owner login. GitLab group paths use slashes.
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_])?)*$Repository name without the .git suffix
my-sitePattern: ^[a-zA-Z0-9_-]([a-zA-Z0-9._-]{0,98}[a-zA-Z0-9_-])?$Branch whose package.json is inspected
mainPattern: ^[a-zA-Z0-9._-]([a-zA-Z0-9\/._-]{0,198}[a-zA-Z0-9._-])?$Git installation used to access the repository, taken from List Git installations
018f5e2a-1234-7890-abcd-1234567890abSuccess response
Node.js application type
create-react-appPossible values: Node.js version
18Application root directory
frontendBuild output directory
distThe npm script to run to build the application
buildThe main entry point file for the application
server.jsPackage manager
npmPossible values: The scripts configured in the package.json file
["build","test"]Unauthenticated response
Validation error response
Error response
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?