Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Url parameter interpolation feature #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dankelleher
Copy link

Allows you to define webhooks like this:

webHooks.add('hook', URI + '/:id/abc')

and trigger like this:

webHooks.trigger('hook', {}, {}, { id: '123' })

…ike this:

```
webHooks.add('hook', URI + '/:id/abc')
```

and trigger like this:

```
webHooks.trigger('hook', {}, {}, { id: '123' })
```
@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 91.86% when pulling aaf82a1 on civicteam:feature/url-parameter-interpolation into baf1413 on roccomuso:master.

@roccomuso
Copy link
Owner

This will be a breaking change for current api.
And also .trigger functions is getting too much params. We should consider a better approach

@dankelleher
Copy link
Author

I don't think it breaks the current API, does it? Unless you have colons in your URL. Then it might break alright.

How about a trigger() function that accepts (name, options) where options is an object of the form {body, headers, parameters}. This is roughly similar to how common http client libraries work, which is effectively what trigger() is anyway.

@roccomuso
Copy link
Owner

it would be better, yep.

Copy link

@Randyblo7 Randyblo7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

Copy link

@Randyblo7 Randyblo7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants