]> git.cworth.org Git - turbot/commitdiff
Put my own creation of the Flask app back
authorCarl Worth <cworth@cworth.org>
Sat, 26 Sep 2020 04:41:27 +0000 (21:41 -0700)
committerCarl Worth <cworth@cworth.org>
Sat, 26 Sep 2020 04:41:27 +0000 (21:41 -0700)
Rather than relying on the one in the Slack events API.

This means the WSGI configuration should work once again.

turbot.py

index 1939c080104695adcb080eb6b8a3936f9f89878b..92921a2dc8aedd92bedbcd6fd7fe5fd26877bde4 100755 (executable)
--- a/turbot.py
+++ b/turbot.py
@@ -1,13 +1,18 @@
 #!/usr/bin/env python3
 
+from flask import Flask
+
 from slackeventsapi import SlackEventAdapter
 from slack import WebClient
 import os
 
+app = Flask(__name__)
+
 slack_signing_secret = os.environ['SLACK_SIGNING_SECRET']
 slack_bot_token = os.environ['SLACK_BOT_TOKEN']
 
-slack_events = SlackEventAdapter(slack_signing_secret, "/slack/events")
+slack_events = SlackEventAdapter(slack_signing_secret, "/slack/events", app)
 slack_client = WebClient(slack_bot_token)
 
-slack_events.start(port=3000)
+if __name__ == '__main__':
+    app.run(debug=True)