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

Get Node.js build settings from archive

Auto-detect Node.js build settings from a package.json inside an archive already on the server.

Get Node.js build settings from archive

get

Auto-detect Node.js build settings from a package.json inside an archive already on the server.

Use this before calling Start Node.js Build to preview what settings will be used, or to let the user review and override values (framework, node version, root directory, output directory, build script) before committing to a build.

The archive must already be present on the website's file storage. Use the Generate Upload URL endpoint to obtain credentials and upload the archive first.

Authorizations
AuthorizationstringRequired

API Token authentication

Path parameters
usernamestringRequiredExample: u123456789
domainstringRequired

Domain name

Example: mydomain.tld
Query parameters
archive_pathstringRequired

The path to the archive file relative to the document root of the vhost

Example: example.zip
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-archive
GET /api/hosting/v1/accounts/{username}/websites/{domain}/nodejs/builds/settings/from-archive?archive_path=text 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?