From 540f9309e1a8f24ebdfab8767c0762085e0a4c4c Mon Sep 17 00:00:00 2001 From: Lili Pavelu Date: Tue, 24 May 2022 15:28:00 +0200 Subject: [PATCH] initial commit --- main.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 main.py diff --git a/main.py b/main.py new file mode 100644 index 0000000..219912b --- /dev/null +++ b/main.py @@ -0,0 +1,18 @@ +from flask import Flask,request,json + +app = Flask(__name__) + +@app.route('/') +def hello(): + return 'Webhooks with Python' + +@app.route('/githubIssue',methods=['POST']) +def githubIssue(): + data = request.json + print(f'Issue {data["issue"]["title"]} {data["action"]} \n') + print(f'{data["issue"]["body"]} \n') + print(f'{data["issue"]["url"]} \n') + return data + +if __name__ == '__main__': + app.run(debug=True) \ No newline at end of file