Hosting: NodeJS

Start Node.js build

Start a Node.js build process using files already present on the website's file storage.

WARNING: on success this overwrites the website's existing contents and cannot be undone — verify this is intended before calling this endpoint.

The source_type must be archive and source_options.archive_path must point to an existing archive file on the server (relative to the website document root). Use the Generate Upload URL endpoint to obtain credentials and upload the archive first.

To auto-detect build settings from an archive before starting, first call the Get Node.js Build Settings from Archive endpoint.

The returned build uuid can be used to poll progress and retrieve logs via the Get Node.js Build Logs endpoint.

post/api/hosting/v1/accounts/{username}/websites/{domain}/nodejs/builds

Path parameters

usernamestring required
Example:u123456789
domainstring required
Example:mydomain.tld

Domain name

Request body

node_version18 | 20 | 22 | 24 required

Node.js version

app_type'create-react-app' | 'gatsby' | 'vite' | 'angular' | 'react' | 'vue' | 'parcel' | 'next' | 'nuxt' | 'nest' | 'express' | 'fastify' | 'astro' | 'svelte' | 'svelte-kit' | 'hono' | 'react-router' | 'nitro' | 'other' nullable required

Node.js application type

root_directorystring nullable required

Application root directory (where package.json is located) relative to public_html

output_directorystring nullable required

Build output directory relative to the root directory

build_scriptstring nullable required

Build script that will be ran to build the application

entry_filestring nullable

The main entry point file for the application

package_manager'npm' | 'yarn' | 'pnpm' nullable

Package manager

source_type'archive' required

The source type of the files

Example request

{
  "node_version": 20,
  "app_type": "vite",
  "root_directory": "webapp",
  "output_directory": "dist",
  "build_script": "build",
  "entry_file": "server.js",
  "package_manager": "npm",
  "source_type": "archive",
  "source_options": {
    "archive_path": "example.zip"
  }
}

Response

Success response

uuidstring

Build UUID

state'pending' | 'running' | 'completed' | 'failed'

Build state

created_atstring date-time

Creation timestamp

updated_atstring date-time

Last update timestamp

Example response

{
  "uuid": "69f07fe2-197a-4fb3-9dae-606f965ad13d",
  "state": "pending",
  "options": {
    "node_version": 24,
    "app_type": "vite",
    "root_directory": "src",
    "output_directory": "dist",
    "build_script": "build",
    "entry_file": "server.js",
    "package_manager": "npm",
    "source_type": "archive",
    "source_options": {
      "archive_path": "archive.zip"
    }
  },
  "created_at": "2024-05-29T05:49:49.067239Z",
  "updated_at": "2024-05-29T05:49:49.067239Z"
}

Changes

Changed in 1 of the 88 revisions of this API.1