Introduction
I have loved the UNIX fortune command since the late 90s. It has lived in my terminal for decades, dropping random quotes, jokes, and poems at exactly the right moments.
At some point I realized I was constantly copy‑pasting fortunes into chats. So I decided to build a tiny microservice that could serve fortunes on demand.
The Minimal Build
This was not a complex system. The core tasks were:
- Convert the legacy flat‑file fortune data into a database
- Expose a small HTTP API to fetch a random fortune
- Add a Slack slash command so the quotes show up where I work
I already had the fortunes converted to SQL from another project, so the data pipeline was mostly done. PostgreSQL made the rest trivial.
The Slack Hook
Slack slash commands are straightforward: the user types a command, Slack sends an HTTP POST to your service, and you respond with JSON.
I used ephemeral messages for the initial response and then allowed the user to post a fortune to the channel if they wanted. It was the right balance between noise and fun.
Slack policy does not allow offensive content, so I had to separate that subset and keep it out of the Slack integration.
The Stack
The service is Go in a Docker container behind NGINX with Let’s Encrypt. Simple, boring, and reliable — which is exactly what I wanted.

Why It Was Worth It
The point was not to build a massive product. It was to take a beloved UNIX tool, wrap it in a modern interface, and make it shareable.
It also reminded me how easy it is to build small services with Go. The standard library handles HTTP cleanly, and the code stays readable without frameworks.
Conclusion
Random fortune cookies are fun. Slack is fun. Go is still my favorite way to build a small, sharp tool.
Check out the final solution.