-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ADD: Implemented webhooks config as mentioned in issue #6
- Loading branch information
jens.kristian.hoel
committed
Sep 6, 2019
1 parent
38494a0
commit 3d6d9c2
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** USE THIS FILE TO CONFIGURE WEBHOOKS FUNCTIONALITY | ||
* | ||
* Each webhook should have a descriptive key, with a function as its value. This function | ||
* can then be referenced in the routes, triggering the webhook on updates. | ||
* | ||
*/ | ||
|
||
module.exports = { | ||
POST_NEW_EVENT: (req) => { | ||
const { id, name, date } = req.body; | ||
const url = `www.someService.com/events/new?id=${id}&name=${name}&date=${date}` | ||
|
||
return new Promise((resolve) => { | ||
// TODO - Make the request to the url | ||
resolve(true) // or some other result | ||
}) | ||
}, | ||
SOME_OTHER_HOOK: () => null, | ||
} |