在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:gorilla/handlers开源软件地址:https://github.com/gorilla/handlers开源编程语言:Go 100.0%开源软件介绍:gorilla/handlersPackage handlers is a collection of handlers (aka "HTTP middleware") for use
with Go's
Other handlers are documented on the Gorilla website. ExampleA simple example using import (
"net/http"
"github.com/gorilla/handlers"
)
func main() {
r := http.NewServeMux()
// Only log requests to our admin dashboard to stdout
r.Handle("/admin", handlers.LoggingHandler(os.Stdout, http.HandlerFunc(ShowAdminDashboard)))
r.HandleFunc("/", ShowIndex)
// Wrap our server with our gzip handler to gzip compress all responses.
http.ListenAndServe(":8000", handlers.CompressHandler(r))
} LicenseBSD licensed. See the included LICENSE file for details. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论