Serve up HTTP 200 on / requests

This commit is contained in:
2017-02-24 00:19:18 +00:00
parent 364130822a
commit 92730450b2

View File

@@ -44,6 +44,10 @@ func printVersion() {
fmt.Println("kotaku-uk-rss " + Version)
}
func serveRoot(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, "OK")
}
func startServer() {
if *port == defaultPort {
if envPort := os.Getenv("PORT"); envPort != "" {
@@ -51,6 +55,7 @@ func startServer() {
}
}
http.HandleFunc("/", serveRoot)
http.HandleFunc("/rss", serveRss)
address := *bind + ":" + *port