mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-10-14 23:17:15 +00:00
14 lines
420 B
JavaScript
14 lines
420 B
JavaScript
|
/**
|
||
|
* Background Cloud Function to be triggered by Pub/Sub.
|
||
|
*
|
||
|
* @param {object} event The Cloud Functions event.
|
||
|
* @param {function} callback The callback function.
|
||
|
*/
|
||
|
exports.helloPubSub = function (event, callback) {
|
||
|
const pubsubMessage = event.data;
|
||
|
const name = pubsubMessage.data ? Buffer.from(pubsubMessage.data, 'base64').toString() : 'World';
|
||
|
|
||
|
console.log(`Hello, ${name}!`);
|
||
|
|
||
|
callback();
|
||
|
};
|