Webhooks
This service allows to create incoming webhooks, in order to allow users to perform some actions directly, bypassing the endpoints authorizations.
#
Features- Generate webhooks for any user through Moleculer REPL
- Allow users to create their own webhooks with a secured endpoint
- Handle different kind of actions, depending on your needs
#
Dependencies#
Install#
Usage#
Generating new webhooksYou generate a webhook by providing a user and an action. The action must be in the list of allowedActions
, in the settings.
#
Through the command lineStart Moleculer in REPL mode and call the generate
action like this:
#
Through a secured endpointPOST
to the /webhooks
endpoint as a logged-in user, providing the action that will be handled by this endpoint as JSON.
#
Posting to a webhookWhen you generate a webhook, you will receive an URI in response. You can then post JSON data to this webhook. It will be handled by the action(s) you defined.
#
Queuing incoming POSTsIf you wish, you can use the Bull task manager to queue incoming POSTs and make sure no data is lost.
All you need to do is add Moleculer's official Bull service as a mixin:
Please look at the official documentation for more information.