Deploying Golang API to Heroku

https://res.cloudinary.com/practicaldev/image/fetch/s--SC9GtUFI--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yepp17gru8daeylgvgwc.png

––– views

1 mins

9 Jun 2021

Deploying a Go API on Heroku

To deploy it on Heroku.

I'll assume you have Heroku cli installed and logged in. or you can start here. Install heroku cli

  • Create a Procfile that points to our binary with one line and place it in the root of the directory
// Profile web: bin/Intersect_api
  • Run the app locally to test using
heroku local
  • Create a heroku app
heroku create intersect-api-v2
  • Then commit our changes on git
git add . git commit -m '💪'
  • And at the end, simply deploy our app using
git push heroku heroku-deploy:master
  • (Optional) Subsequent change can be commit using
git push heroku master

Extra

  • You can read the logs from with
heroku logs

That's about it. Now we can check our server at,

https://intersect-api-v2.herokuapp.com


Not Playing

Home

About

Blog

Work

Made with nextjs and ❤