mirror of
https://github.com/jimeh/kotaku-uk-rss.git
synced 2026-02-19 02:46:41 +00:00
Serve up HTTP 200 on / requests
This commit is contained in:
5
main.go
5
main.go
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user