DEMO: Node.js
This chapter introduces how to call the Ultra Stream API in Node.js.
Download DEMO: ultra-stream-api-demo-nodejs.zip
DEMO Structure
ultra-stream-api-demo-nodejs
|
|-- httpUtils.js // based on HTTP get and upload in Node.js
|-- xxxx.mwf // the uploaded file called by upload-update-file 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 or newer; it is recommended that you use LTS Releases.
Running Mode
- Navigate into the DEMO directory in the terminal.
cd ultra-stream-demo-nodejs
- Replace deviceIP with the tested IP address of device in get.js and upload.js
- Run get.js
node get
- Run upload.js
node upload