http://www.jeffreybolle.com/blog/run-google-go-web-apps-behi...
I also use MySql on Digital Ocean with a $10/month droplet. The few issues at first where that I started with a $5/month which didn't enough RAM so I'd run out of memory until I created swap:
https://www.digitalocean.com/community/tutorials/how-to-add-...
Still need to make it a daemon, but I'm not finished. I have one big method to set up my pages. I could write a blog, github repo or create a summary page on my site, if there's any interest.
func runWeb() {
serveSingle("/robots.txt", "./robots.txt")
http.Handle("/css/", http.StripPrefix("/css/", http.FileServer(http.Dir("./css/"))))
http.Handle("/resources/", http.StripPrefix("/resources/", http.FileServer(http.Dir("./resources/"))))
http.Handle("/static", http.FileServer(http.Dir("./static/")))
http.HandleFunc("/chinese", chineseHomeHandler)
http.HandleFunc("/french", frenchHomeHandler)
http.HandleFunc("/chinese/numbers", chineseNumbersHomeHandler)
// Many handlers deleted ...
http.HandleFunc("/", homeHandler)
// http.ListenAndServe("localhost:9999", nil)
port := GetPort()
fmt.Println("listening...", port)
err := http.ListenAndServe(port, nil)
if err != nil {
panic(err)
}
}/* http://stackoverflow.com/questions/14086063/serve-homepage-a... /
func serveSingle(pattern string, filename string) {
http.HandleFunc(pattern, func(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, filename)
})
}