pyscript icon indicating copy to clipboard operation
pyscript copied to clipboard

Webhook Trigger

Open contagon opened this issue 1 year ago • 0 comments

This PR closes #353 and adds a new webhook trigger defined as,

@webhook_trigger(webhook_id, str_expr=None, local_only=True, methods={"POST", "PUT"}, kwargs=None)
def foo(payload):
    pass

When looking into this, I was hoping that webhooks trigger events, but they unfortunately don't leading to this solution. I've been using this for about a week and it seems to be working stably. I've added a few things to the tests to make sure things at least run. I'm not sure how to actually call a webhook in a test, but happy to do it if there is a way.

I also added some documentation that hopefully covers everything.

Let me know if any changes or tweaks are needed!

contagon avatar Mar 12 '24 15:03 contagon