Finally, Astro-Date is online. It’s a Slack bot that tells you what phenomenon was captured on the date you were born, or any other date.
From a technical perspective, it’s just Python code that runs on Vercel. So, when you call the bot in Slack and send a date, it triggers the server, which sends it to the NASA API to get the photo and data, then sends it back to Slack. But from another perspective, it shows you how the universe celebrated your birthday.
At first, I thought that this project wouldn’t take more than an hour and that I could make it, test it, and submit it in one day, but it wasn’t like that. I had some issues that were clear, so I fixed them, but some needed debugging, like the ‘respond before process’ issue. The code was sending ‘OK’ to Slack after it got the request; then, it would process, get the data from the NASA API, and send it to Slack. But what really happens is that the server would go down after sending ‘OK’ to Slack, so it never sent back the data.
So, I changed it to ‘process before response,’ and a simple line, process_before_response=True, fixed everything.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.