From: Carl Worth Date: Sat, 26 Sep 2020 04:41:27 +0000 (-0700) Subject: Put my own creation of the Flask app back X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=38af993bca0499a35ef2c6d95a9bc82515424a60;p=turbot Put my own creation of the Flask app back Rather than relying on the one in the Slack events API. This means the WSGI configuration should work once again. --- diff --git a/turbot.py b/turbot.py index 1939c08..92921a2 100755 --- 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)