April 2018
Intermediate to advanced
332 pages
8h 5m
English
Now that we have provided the required credentials as well as subscribed to a Pub/Sub topic, we will set up the Pub/Sub client. Follow these steps:
$ npm init -y
$ npm install @google-cloud/pubsub --save
var PubSub = require('@google-cloud/pubsub'); var projectId = 'pi-iot-project'; var stateSubscriber = 'dht11-data' // Instantiates a client var pubsub = new PubSub({ projectId: ...