Last active
March 23, 2025 17:35
-
-
Save elephantsneverforget/bb2b82afb4f1b8ef820d65b1fdcdd65d 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