simplify routing, rm addremove.go

will implement a full rest API later
This commit is contained in:
Jimmy Zelinskie
2013-12-05 20:24:54 -05:00
parent fe1a4a6a65
commit 2b7d5b5bf0
2 changed files with 3 additions and 29 deletions
+3 -12
View File
@@ -83,18 +83,6 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
defer atomic.AddInt64(&s.deltaRequests, 1)
r.Close = true
switch r.URL.Path {
case "/stats":
s.serveStats(w, r)
return
case "/add":
s.serveAdd(w, r)
return
case "/remove":
s.serveRemove(w, r)
return
}
_, action := path.Split(r.URL.Path)
switch action {
case "announce":
@@ -103,6 +91,9 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
case "scrape":
s.serveScrape(w, r)
return
case "stats":
s.serveStats(w, r)
return
default:
fail(errors.New("Unknown action"), w, r)
return