Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Background Cloud Function to be triggered by Pub/Sub.
- * This function is exported by index.js, and executed when
- * the trigger topic receives a message.
- *
- * @param {object} event The Cloud Functions event.
- * @param {function} callback The callback function.
- */
- exports.helloPubSub = (event, callback) => {
- const pubsubMessage = event.data;
- const name = pubsubMessage.data ? Buffer.from(pubsubMessage.data, 'base64').toString() : 'World';
- console.log(`Hello, ${name}!`);
- callback(1);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement