Add /domain resource to DNS REST API

This commit is contained in:
Adam Harrison authored and Paul Bellamy committed 2015-06-11 10:26:07 +01:00
1 parent 9955de3e9b
commit a1007411ad
1 file changed
+4
+4
View File
@@ -34,6 +34,10 @@ func ServeHTTP(listener net.Listener, version string, server *DNSServer, domain
fmt.Fprintln(w, db.Status())
})
muxRouter.Methods("GET").Path("/domain").HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, db.Domain())
})
muxRouter.Methods("PUT").Path("/name/{id:.+}/{ip:.+}").HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
reqError := func(msg string, logmsg string, logargs ...interface{}) {
httpErrorAndLog(Warning, w, msg, http.StatusBadRequest, logmsg, logargs...)