Setting Node.js Version on a Domain

Use the set-version node to set a particular Node.js version on a domain.

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

The request XML packet setting a particular Node.js version on a domain includes the set-version operation node:

<packet>
<packet>
  <extension>
    <call>
      <nodejs>
        <set-version>
          <domain>...</domain>
          <version>...</version>
        </set-version>
      </nodejs>
    </call>
  </extension>
</packet>

The set-version node contains the following nodes:

  • The domain node is required. It specifies the domain name. Data type: string.
  • The version node is required. It specifies the Node.js version. Data type: string.
 

Response Packet Structure

The output XML packet is structured as follows:

<packet>
  <extension>
    <call>
      <result>
        <status>...</status>
        ...
        <nodejs>
          <set-version/>
        </nodejs>
      </result>
    </call>
  </extension>
</packet>
  • The result node is required. It wraps the response received from the server. This node contains the following nodes:
    • The status node is required. It specifies the execution status of the set-version operation. Data type: result_status. Allowed values: ok | error.
    • The errcode node is optional. It is used to return the error code when the set-version operation fails. Data type: unsignedInt.
    • The errtext node is optional. It is used to return the error message if the set-version operation fails. Data type: string.
    • The nodejs node is optional. It is present if the operation was completed successfully and contains the set-version node.
 

Samples

This request XML packet sets the Node.js version 4.4.7 on the domain example.com:

<packet>
  <extension>
    <call>
      <nodejs>
        <set-version>
          <domain>example.com</domain>
          <version>4.4.7</version>
        </set-version>
      </nodejs>
    </call>
  </extension>
</packet>

Response:

<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.8.0">
  <extension>
    <call>
      <result>
        <status>ok</status>
        <nodejs>
          <set-version/>
        </nodejs>
      </result>
    </call>
  </extension>
</packet>
 

Leave your feedback on this topic here

If you have questions or need support, please visit the Plesk forum or contact your hosting provider.
The comments below are for feedback on the documentation only. No timely answers or help will be provided.