Skip to content

Instantly share code, notes, and snippets.

@PamornT
Last active October 5, 2019 02:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PamornT/3d8b9a066e685ec23aa37f4a2188bca1 to your computer and use it in GitHub Desktop.
Save PamornT/3d8b9a066e685ec23aa37f4a2188bca1 to your computer and use it in GitHub Desktop.
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