diff --git a/app/server.py b/app/server.py index a181502..b31c277 100644 --- a/app/server.py +++ b/app/server.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 import logging -from flask import Flask +from flask import Flask, abort, jsonify from github_webhook import Webhook from . import config @@ -11,5 +11,11 @@ logging.basicConfig(level=logging.INFO) app = Flask(__name__) webhook = Webhook(app, secret=config.GITHUB_WEBHOOK_SECRET) + +@webhook.hook(event_type="ping") +def ping(data): + return abort(jsonify({"ping": "pong"})) + + if __name__ == "__main__": app.run(host="0.0.0.0")