Now we're ready to start our project locally! 🙌
With your virtual environment turned on and your secrets exported to the environment, go ahead and start your app:
python app.py
Since Slack will need to talk to your app through teh interwebs, let's expose our app to the world wide web through an Ngrok tunnel. In a terminal window, open up an ngrok tunnel for the port your Flask app will be served on locally. (The default port for Flask is 5000)
ngrok http 5000
Your terminal output should show both an http and https url ending in ngrok.io
. Copy the https url and navigate in your browser to the Events Subscriptions tab in your app's settings page. In the Request URL form, paste the ngrok url and add /listening
to the end.
Flip the Enable Events switch to on and you should receive an alert letting you know Slack is about to turn on the Events tap.
After you've enabled events, you'll need to add a redirect URL in your app's OAuth & Permissions settings page. This is where the /thanks
endpoint we've set up earlier in our Flask app comes in. Just append /thanks
to the end of the ngrok https url and paste it into the Redirect URL(s) form on the OAuth Settings section and hit save.
Now your app is ready to be installed on a Slack team! 🎉
Next More Info: README
Previous Section 4: App Credentials