go-http-redirect

Simple HTTP Redirector App written in Golang which supports Heroku

MIT License

Stars
1
Committers
2

Go HTTP Redirect

This is a simple HTTP redirect service which can be run as a stand-alone service. It can be optionally run on Heroku which is the initial use case.

Heroku provides easy hosting with default hostnames at https://{projectName}.herokuapp.com. This project provides an easy way to deploy a project to Heroku to redirect traffice to another URL.

No code modifications are necessary. URL and HTTP status are both set via environment variables.

Configuration

Set the following Environment Variables:

  1. REDIRECT_URL: URL where the requestor should be redirected.
  2. HTTP_STATUS: the HTTP status code to use. 302 is used by default.
  3. PORT: port number which the service should run on, e.g. 8080. Note: Heroku will automatically set this environment variable.

Installation

Heroku

$ heroku create
$ git push heroku master
$ heroku open

or

Credits

Heroku support provided via github.com/grokify/goheroku.