Followed the events example from this page but it went awry, with my Stackdriver logs showing this:
Official GCP docs for pubSub-triggered functions has this as the NodeJS 8/10 example:
exports.helloPubSub = (data, context) => {
const pubSubMessage = data;
const name = pubSubMessage.data
? Buffer.from(pubSubMessage.data, 'base64').toString()
: 'World';
console.log(`Hello, ${name}!`);
};
So might the second argument actually be the context object instead of callback?