commit 540f9309e1a8f24ebdfab8767c0762085e0a4c4c Author: Lili Pavelu Date: Tue May 24 15:28:00 2022 +0200 initial commit 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