Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Package gorilla/handlers is a collection of useful middleware for Go HTTP services & web applications 🛃

License

NotificationsYou must be signed in to change notification settings

gorilla/handlers

TestingCodecovGoDocSourcegraph

Package handlers is a collection of handlers (aka "HTTP middleware") for usewith Go'snet/http package (or any framework supportinghttp.Handler), including:

Other handlers are documentedon the Gorillawebsite.

Example

A simple example usinghandlers.LoggingHandler andhandlers.CompressHandler:

import ("net/http""github.com/gorilla/handlers")funcmain() {r:=http.NewServeMux()// Only log requests to our admin dashboard to stdoutr.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.

About

Package gorilla/handlers is a collection of useful middleware for Go HTTP services & web applications 🛃

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors46


[8]ページ先頭

©2009-2025 Movatter.jp