Deploying a Golang Project to Heroku
The short version is it’s ridiculously easy!
I recently made a Bible reader that uses the Spritz-like Rapid Serial Visual Presentation speed reading technique. I wrote it in Go and I wanted to easily host it…Heroku to the rescue in 3 easy steps:
When you do your
heroku create instead pass it a buildpack:
heroku create -b https://github.com/kr/heroku-buildpack-go.git
The buildpack needs to know where to put your code in the image…so you make a
.godir file in your project root:
Finally, Heroku needs to know what command to run to spin up the app, which is the
web: speedy-bible -port=$PORT
git push heroku master (after you do the usual git init stuff) will do the trick for your Golang app!