-
Notifications
You must be signed in to change notification settings - Fork 122
Multiple handlers #21
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
It should be possible to create multiple handlers and chain them through their error handlers, but I wonder if the use-case could be addressed (given knowledge of the inbound events) by a single handler. handler.on('issues', function (event) {
switch(event.payload.repository.id) {
case 23: return doThis();
case 36: return doThat();
case 37: return doSomethingElseEntirely();
}
}); Would something like this work for what you have in mind? |
In my case even the url must be different because (correct me if I'm wrong) I can't send custom data from github and I can have multiple "deployment scenarios/users" per single repository. I need to somehow pass in the deployment_id. |
Got it––thanks, @isvaljek. Is there any way to configure the deployment scenarios/users within the app (rather than within github), though? (please forgive all the questions! Just trying to imagine any alternative approaches that could address the specific need before we contemplate a code change to address it.) |
@rjz I grab the deployment details from a different app by deploy_id. It's just an xhr call to the other app, so I guess it could all be stored locally. What I meant to say is that I don't know of a way to pass any extra data from github webhook to my app. |
There's been additional discussion of a similar case in #22 that I believe could address this need. Closing this out to move further discussion over there, but please correct me if my understanding's off-base! |
Is having a multiple webhook handlers in a single node script a supported code path?
Like:
http://example.com/pushmepullme/23
http://example.com/pushmepullme/36
http://example.com/pushmepullme/37
I tried creating an array of handlers but it seems to only work with element 0.
The text was updated successfully, but these errors were encountered: