Name Last Update
db Loading commit data...
models Loading commit data...
setting Loading commit data...
utils Loading commit data...
.cfignore Loading commit data...
.gitignore Loading commit data...
CHANGELOG.md Loading commit data...
README.md Loading commit data...
amqp.js Loading commit data...
index.js Loading commit data...
manifest.yml Loading commit data...
package-lock.json Loading commit data...
package.json Loading commit data...

EI-PaaS-SampleCode/dataworker-nodejs-sample


開發環境

  • Node.js: 8.10.0

1 建置

Install dependencies
$ npm install
本地端設定 setting.dev.js
編輯各Database和AMQP的設定, 根據DabaseType(mongodb, postgresql, and influxdb)決定資料寫入到哪種Database類型

2 於本地端啟動 dataworker-nodejs-sample

$ npm run debug

WISE-PaaS

0 事前準備

  • 檢查WISE-PaaS上的buildpack nodejs_buildpack_1620 是否存在.
  • 檢查 rabbitmq, mongodb, postgresql and influxdb service instance 是否存在.

1 Push Application to PCF

$ cf push -f manifest.yml

2 Test data

  • MQTT
    • topic: data
    • payload: {"AI01":28.56,"DI01":1,"ts":"2018-03-20T08:36:28.912Z"}