forked from platypush/platypush
Added example with return to the webhook handler.
This commit is contained in:
parent
baee33b88f
commit
7c7e488867
1 changed files with 3 additions and 1 deletions
|
@ -704,7 +704,6 @@ from platypush.events.http.hook import WebhookEvent
|
||||||
|
|
||||||
hook_token = "abcdefabcdef"
|
hook_token = "abcdefabcdef"
|
||||||
|
|
||||||
|
|
||||||
# Expose the hook under the /hook/at_home endpoint
|
# Expose the hook under the /hook/at_home endpoint
|
||||||
@when(WebhookEvent, hook="at_home")
|
@when(WebhookEvent, hook="at_home")
|
||||||
def at_home_webhook(event: WebhookEvent):
|
def at_home_webhook(event: WebhookEvent):
|
||||||
|
@ -717,6 +716,9 @@ def at_home_webhook(event: WebhookEvent):
|
||||||
return
|
return
|
||||||
|
|
||||||
run('procedure.at_home')
|
run('procedure.at_home')
|
||||||
|
|
||||||
|
# Return anything back to the client
|
||||||
|
return {'status': 'ok'}
|
||||||
```
|
```
|
||||||
|
|
||||||
Then you can invoke your custom logic over HTTP:
|
Then you can invoke your custom logic over HTTP:
|
||||||
|
|
Loading…
Reference in a new issue