You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Webhooks are user-defined HTTP POST callbacks. They provide a lightweight mechanism for letting remote applications receive push notifications from the backend, without requiring polling. For example, you may want any event updates to be pushed to a Discord channel, or some sort of messaging app.
The text was updated successfully, but these errors were encountered:
module.exports={POST_NEW_EVENT: (req)=>{const{ id, name, date }=req.body;consturl=`www.someService.com/events/new?id=${id}&name=${name}&date=${date}`returnnewPromise((resolve)=>{HTTPrequestToService(url)// Make the request to the urlresolve(true)// or some other result})},SOME_OTHER_HOOK: ()=>null,}
route/events.js:
// Import the webhooks configconstwebhooks=require('../../config/webhooks');router.POST('/new',(req,res)=>{// Trigger a webhookwebhooks.POST_NEW_EVENT(req);// ... do further SQL queries and actual endpoint stuff});
Webhooks are user-defined HTTP POST callbacks. They provide a lightweight mechanism for letting remote applications receive push notifications from the backend, without requiring polling. For example, you may want any event updates to be pushed to a Discord channel, or some sort of messaging app.
The text was updated successfully, but these errors were encountered: