Include DNS version and domain in status

This commit is contained in:
Adam Harrison committed 2015-03-17 14:28:26 +00:00
1 parent 9cf7da7277
commit 50f6402774
2 files changed
+4 -3

No files matched your search

+3 -2
View File
@@ -17,12 +17,13 @@ func httpErrorAndLog(level *log.Logger, w http.ResponseWriter, msg string,
level.Printf("[http] "+logmsg, logargs...)
}
func ListenHttp(domain string, db Zone, port int) {
func ListenHttp(version string, domain string, db Zone, port int) {
router := mux.NewRouter()
router.Methods("GET").Path("/status").HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
io.WriteString(w, "ok")
io.WriteString(w, fmt.Sprintln("weave DNS", version))
io.WriteString(w, fmt.Sprintln("Serving domain", domain))
})
router.Methods("PUT").Path("/name/{identifier:.+}/{ip:.+}").HandlerFunc(func(w http.ResponseWriter, r *http.Request) {