mirror of
https://github.com/syumai/workers.git
synced 2025-03-10 17:29:11 +00:00
rename routeHandler in r2-image-server to ServeHTTP
This commit is contained in:
parent
5c55a2ebf7
commit
51d52249fc
@ -94,7 +94,7 @@ func (s *server) delete(w http.ResponseWriter, req *http.Request, key string) {
|
||||
w.Write([]byte("successfully deleted image"))
|
||||
}
|
||||
|
||||
func (s *server) routeHandler(w http.ResponseWriter, req *http.Request) {
|
||||
func (s *server) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
key := strings.TrimPrefix(req.URL.Path, "/")
|
||||
switch req.Method {
|
||||
case "GET":
|
||||
@ -119,5 +119,5 @@ func main() {
|
||||
fmt.Fprintf(os.Stderr, "failed to start server: %v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
workers.Serve(http.HandlerFunc(s.routeHandler))
|
||||
workers.Serve(s)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user