Open mandolf0 opened 1 year ago
This is getting me halfway there in NodeJS.
var obj = req.payload; const map = new Map(Object.entries(obj)); for (const [key, value] of Object.entries(obj)) { // console.log(`${key} ${value}`); if(key =="body") { console.log(`${key} ${value}`); // } }
And, btw, I'm sending a POST from the Appwrite fn with the proxy response to a NodeJS server outside of Appwrite. This way I can debug the function without reuploading anything.
Stripe webhook-> this proxy -> appwrite fn - > dev server.
const event = JSON.parse(payload || '{}');
console.log(`\nEvent is: ${event}`);
//send the webhook data to the LAN dev server for debug
request({
url: "http://10.0.0.64:5000/webhook",
method: "POST",
json: true,
body: event
}, function (error, response, body) {
console.log(response);
});
Thank you for this Container.
However, I cannot wrap my head around parsing the output from the cloud function. The fn spits out the response in a format that I can't seem to tame. It must be the json_encode used in the Swoole curl.
I could not get this to be readable with Dart or NodeJS. Any tips?