- Create your application
package main
import (
"os"
"net/http"
"log"
"fmt"
)
func main() {
p := os.Getenv("PORT")
if p == "" {
p = "3000"
}
http.HandleFunc("/ping", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("pong"))
})
log.Println(http.ListenAndServe(fmt.Sprintf(":%s", p), nil))
}
- Create
Procfile
web: app_name
- Install and setup godep
$ go get github.com/tools/godep
$ godep save -r
- Set heroku app & deploy
$ heroku git:remote -a go-deploy-demo
$ git push heroku master