Created
February 19, 2025 19:08
-
-
Save elephantsneverforget/8a1a2de2f9a7f097bb9f654e62f2541e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const functions = require('@google-cloud/functions-framework'); | |
functions.cloudEvent('helloPubSub', cloudEvent => { | |
// The Pub/Sub message from Elevar is passed as the CloudEvent's data payload. | |
const base64Data = cloudEvent.data.message.data; | |
// Decode the base 64 encoded message | |
const data = Buffer.from(base64Data, 'base64').toString() | |
// Log the results | |
console.log(data); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment