From 04b53703adf165d71f601ff9f59a01d1ddbd3d2d Mon Sep 17 00:00:00 2001 From: Daniel Abraham Date: Wed, 21 Aug 2024 10:07:37 +0300 Subject: [PATCH 1/2] Don't limit trigger to GET requests --- quickstart/autokitteh.yaml | 3 +-- quickstart/program.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/quickstart/autokitteh.yaml b/quickstart/autokitteh.yaml index e2de412e..626e8a62 100644 --- a/quickstart/autokitteh.yaml +++ b/quickstart/autokitteh.yaml @@ -11,7 +11,6 @@ project: triggers: - name: http_get connection: http_conn - event_type: get data: path: trigger_path - call: program.py:on_http_get + call: program.py:on_http_request diff --git a/quickstart/program.py b/quickstart/program.py index ed1dc487..760e5c60 100644 --- a/quickstart/program.py +++ b/quickstart/program.py @@ -1,4 +1,4 @@ -"""Basic handler for incoming HTTP GET requests.""" +"""Basic handler for incoming HTTP requests.""" import time @@ -6,7 +6,7 @@ FIVE_SECONDS = 5 -def on_http_get(event): +def on_http_request(event): print(f"Received {event.data.method} request") iterations = int(event.data.url.query.get("iterations", "0")) From 33be14d43a1fd64d670b9dc124a5d6aa4c3034ea Mon Sep 17 00:00:00 2001 From: Daniel Abraham Date: Wed, 21 Aug 2024 10:17:48 +0300 Subject: [PATCH 2/2] update trigger name --- quickstart/autokitteh.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickstart/autokitteh.yaml b/quickstart/autokitteh.yaml index 626e8a62..f0fc76e7 100644 --- a/quickstart/autokitteh.yaml +++ b/quickstart/autokitteh.yaml @@ -9,7 +9,7 @@ project: - name: http_conn integration: http triggers: - - name: http_get + - name: http_request connection: http_conn data: path: trigger_path