diff --git a/handlers/shutdown.go b/handlers/shutdown.go new file mode 100644 index 0000000..b0d1a8a --- /dev/null +++ b/handlers/shutdown.go @@ -0,0 +1,13 @@ +package handlers + +import ( + "net/http" + "text/template" +) + +// ShutdownHandler handles the shutdown page +func ShutdownHandler(w http.ResponseWriter, r *http.Request) { + t := template.Must(template.New("shutdown.html").ParseFiles("templates/shutdown.html")) + + t.Execute(w, nil) +} diff --git a/main.go b/main.go index 92addad..ad31ef3 100644 --- a/main.go +++ b/main.go @@ -33,6 +33,7 @@ func main() { http.HandleFunc("/report/", makeHandler("report", handlers.ReportHandler)) http.HandleFunc("/badge/", makeHandler("badge", handlers.BadgeHandler)) http.HandleFunc("/high_scores/", handlers.HighScoresHandler) + http.HandleFunc("/shutdown/", handlers.ShutdownHandler) http.HandleFunc("/", handlers.HomeHandler) fmt.Println("Running on 127.0.01:8080...") diff --git a/templates/home.html b/templates/home.html index 669ecec..bc9b297 100644 --- a/templates/home.html +++ b/templates/home.html @@ -143,6 +143,7 @@
Hello. Unless someone or some company would like to sponsor Go Report Card, I'm planning to turn it off, probably in the next month.
+Go Report Card runs on a Digital Ocean instance for $5 a month, and unfortunately I don't feel like paying to keep it running anymore.
+If you or your company would like to sponsor Go Report Card to keep it online, please feel free to reach out to me (Shawn) and we can arrange something.
+If I don't hear anything by mid to late August, I will go ahead and shut Go Report card down. The code can be found on GitHub at http://github.com/gojp/goreportcard
+ +