Last active
October 5, 2019 02:30
-
-
Save PamornT/3d8b9a066e685ec23aa37f4a2188bca1 to your computer and use it in GitHub Desktop.
This file contains 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
exports.ThaiPostWebHook = functions.region(REGION).https.onRequest((req, res) => { | |
console.log('Start Webhook'); | |
push_update_status(req); | |
res.status(200).send("OK").end(); | |
}); | |
const push_update_status = (req) => { | |
return request({ | |
method: `POST`, | |
uri: `${LINE_MESSAGING_API}/broadcast`, | |
headers: LINE_HEADER, | |
body: JSON.stringify({ | |
messages: [ | |
{ | |
type: `text`, | |
text: '\uDBC0\uDC7F Update from Webhook!!\n\n' + JSON.stringify(req.body) | |
} | |
] | |
}) | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment