~1 minute

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:

Buildpack

When you do your heroku create instead pass it a buildpack:

heroku create -b https://github.com/kr/heroku-buildpack-go.git

.godir

The buildpack needs to know where to put your code in the image…so you make a .godir file in your project root:

github.com/zhubert/speedy-bible

Procfile

Finally, Heroku needs to know what command to run to spin up the app, which is the Procfile naturally:

web: speedy-bible -port=$PORT

Now a git push heroku master (after you do the usual git init stuff) will do the trick for your Golang app!

Tagged with: programming

My first novel is coming soon-ish!

Check out Singular