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
- Navigate into the DEMO directory in the terminal.
cd magewell-cloud-api-demo-nodejs
- Replay CLOUD_IP in constant.js with the IP address of the Magewell Cloud.
- Run get.js.
node get
- Run upload.js.
node upload