A few weeks ago, I posted a note about a tinkering project with the purpose of building a small web API with Flask to get notifications on Slack from my WordPress blog.
At the time, the application was deployed on a Raspberry Pi and I wanted to try and get the application to run on Heroku.
In the process, I adopted some of Heroku best practices on the management of the environment setup. I cleaned the code so that it can be shared on GitHub and I played around with Slack message formatting capabilities.
What did I learn?
At some point during the migration of the application from the Raspberry Pi, I spent a lot of time being stuck with an “unauthorized access” error. I assumed that the issue was coming from my poor understanding of the port routing logic of Heroku. I was wrong, as the issue was linked to the definition of the Slack API Key.
In the process, I learned that the official documentation is often the best place to find reliable information on a service, as the Heroku documentation show me the correct path to the solution.
I also learned that you need to get as much insights as possible from logs and error messages before starting to mess with your code.
I also used Slack documentation for message formatting.
The code of this project has been shared on Github