DEMO (Node.js)

This chapter introduces how to call the Magewell Cloud API in Node.js.

Download DEMO: magewell-cloud-api-demo-nodejs.zip

DEMO Structure

magewell-cloud-api-demo-nodejs
|
|-- httpUtils.js  // based on HTTP get, post and upload in Node.js
|-- constant.js   // constant
|-- xxxx.mwf      // the uploaded file called by 'uploadFirmware' interface in upload.js
|-- get.js        // request data using GET
|-- upload.js     // upload file using POST

Requirements

  • Operating System: macOS, Linux, Windows
  • Node.js Runtime: 8.x and later; it is recommended that you use LTS Releases.

Running Mode

  1. Navigate into the DEMO directory in the terminal.
    cd magewell-cloud-api-demo-nodejs
    
  2. Replay CLOUD_IP in constant.js with the IP address of the Magewell Cloud.
  3. Run get.js.
    node get
    
  4. Run upload.js.
    node upload
    

results matching ""

    No results matching ""

    results matching ""

      No results matching ""