Registry / web-framework / urfave-negroni-v2

urfave-negroni-v2

JSON →
library2.0.2gogounverified

Package negroni provides an idiomatic approach to web middleware in Go.

go get github.com/urfave/negroni/v2
INSTALL
IMPORT
SIG · URFAVE-NEGRONI-V2
U
urfave-negroni-v2
web-frameworkgov2.0.2
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.

negroni
github.com/urfave/negroni/v2

Create a classic Negroni middleware stack

package main import ( "net/http" "github.com/urfave/negroni/v2" ) func main() { mux := http.NewServeMux() mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { w.Write([]byte("Hello")) }) n := negroni.Classic() n.UseHandler(mux) http.ListenAndServe(":3000", n) }
Debug
Known issues
breakingv2 has breaking API changes from v1 (e.g., removed Negroni.HandlerFunc).
fix
Use negroni.Handler or adapt v1 code to v2 API.
affects: >=2.0.0
Upgrade
Version history
2.0.2latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources
urfave-negroni-v2 — go get urfave-negroni-v2 · libregistry