Registry / web-framework / containous-alice

containous-alice

JSON →
library0.0.0-20181107144136-d83ebdd94cbdgogounverified

A Go package providing a convenient way to chain HTTP handlers.

go get github.com/containous/alice
INSTALL
IMPORT
SIG · CONTAINOUS-ALICE
C
containous-alice
web-frameworkgov0.0.0-20181107144136-d83ebdd94cbd
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

alice
github.com/containous/alice

Chain HTTP middleware handlers

package main import ( "net/http" "github.com/containous/alice" ) func myHandler(w http.ResponseWriter, r *http.Request) { w.Write([]byte("Hello")) } func main() { chain := alice.New( func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Header().Set("X-Custom", "value") next.ServeHTTP(w, r) }) }, ).Then(http.HandlerFunc(myHandler)) http.ListenAndServe(":8080", chain) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.0.0-20181107144136-d83ebdd94cbdlatest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources
containous-alice — go get containous-alice · libregistry