releasing 0.58 to handle control+c interrupts.

compilable now. but FUSE mount is not working.
This commit is contained in:
Chris Lu
2014-05-13 11:25:48 -07:00
parent 750e1aaaa5
commit dc24bad791
8 changed files with 221 additions and 166 deletions

View File

@@ -26,6 +26,7 @@ func NewFilerServer(r *http.ServeMux, port int, master string, dir string, colle
return
}
r.HandleFunc("/__api__", fs.filerApiHandler)
r.HandleFunc("/", fs.filerHandler)
return fs, nil

View File

@@ -0,0 +1,20 @@
package weed_server
import (
"net/http"
)
func (fs *FilerServer) filerApiHandler(w http.ResponseWriter, r *http.Request) {
switch r.Method {
case "GET":
fs.GetOrHeadHandler(w, r, true)
case "HEAD":
fs.GetOrHeadHandler(w, r, false)
case "DELETE":
fs.DeleteHandler(w, r)
case "PUT":
fs.PostHandler(w, r)
case "POST":
fs.PostHandler(w, r)
}
}