Get Node.js build settings from archive
Auto-detect Node.js build settings from a package.json inside an archive already on the server.
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.
API Token authentication
u123456789Domain name
mydomain.tldThe path to the archive file relative to the document root of the vhost
example.zipSuccess 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-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?