Introduction
Heroku is a popular cloud platform for hosting web applications. It is a great platform for hosting Golang applications, but it can be tricky to serve them over HTTP instead of HTTPS. In this article, we will discuss how to serve a Golang app on Heroku using HTTP instead of HTTPS. We will cover the steps needed to configure the Heroku application and the Golang application to serve over HTTP. We will also discuss the benefits of using HTTP instead of HTTPS. By the end of this article, you should have a better understanding of how to serve a Golang app on Heroku using HTTP instead of HTTPS.
Solution
The simplest way to serve a Golang app on Heroku using http instead of https is to use a custom domain name. This can be done by setting up a CNAME record in your DNS settings that points to the Heroku app. Once the CNAME record is set up, you can then configure your Heroku app to use the custom domain name instead of the default Heroku URL. This will allow you to serve your Golang app on Heroku using http instead of https.
Delete the 's'
from the URL when you try to access your app, that’s all it takes.
Just make sure you start the Go web server in normal (HTTP) mode. The HTTPS layer is added by the Heroku platform, but your app is still available via both HTTP and HTTPS protocol.
So for example if you access your app using the URL:
https://myapp.herokuapp.com
You may also use
http://myapp.herokuapp.com