GO1.5标准包http.FileServer的拔高用法.

来源:互联网 时间:1970-01-01

import ( "fmt" "net/http")func main() { h := http.FileServer(http.Dir("./")) http.ListenAndServe(":1789", ce(h))}func ce(h http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fmt.Println(r.URL.Path) h.ServeHTTP(w, r) })}



相关阅读:
Top