You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Blaz Smehov 1244196d64 chore: refactor api server, add tests 1 月之前
..
.editorconfig chore: refactor api server, add tests 1 月之前
.gitignore chore: refactor api server, add tests 1 月之前
LICENSE chore: refactor api server, add tests 1 月之前
Makefile chore: refactor api server, add tests 1 月之前
README.md chore: refactor api server, add tests 1 月之前
canonical.go chore: refactor api server, add tests 1 月之前
compress.go chore: refactor api server, add tests 1 月之前
cors.go chore: refactor api server, add tests 1 月之前
doc.go chore: refactor api server, add tests 1 月之前
handlers.go chore: refactor api server, add tests 1 月之前
logging.go chore: refactor api server, add tests 1 月之前
proxy_headers.go chore: refactor api server, add tests 1 月之前
recovery.go chore: refactor api server, add tests 1 月之前

README.md

gorilla/handlers

Testing Codecov GoDoc Sourcegraph

Package handlers is a collection of handlers (aka “HTTP middleware”) for use with Go’s net/http package (or any framework supporting http.Handler), including:

Other handlers are documented on the Gorilla website.

Example

A simple example using handlers.LoggingHandler and handlers.CompressHandler:

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))
}

License

BSD licensed. See the included LICENSE file for details.