Awesome Go

muxchain

CategoryWeb Frameworks
SubcategoryMiddlewares
Stars0

Lightweight middleware for net/http

About muxchain

MuxChain

MuxChain is a small package designed to complement net/http for specifying chains of handlers. With it, you can succinctly compose layers of middleware without introducing large dependencies or effectively defeating the type system.

Example

muxchain.Chain("/", logger, gzipHandler, echoHandler)
http.ListenAndServe(":8080", muxchain.Default)

This specifies that all patterns matched should be handled by the logger, then gzip, then echo. Since we're chaining to the default MuxChain, we can just pass that to http.ListenAndServe. You can see a more complete example in the "sample" directory.

License

BSD 3-clause (see LICENSE file)

Frequently Asked Questions

What is muxchain?

muxchain is a Web Frameworks library for the Go programming language. Lightweight middleware for net/http

How do I install muxchain?

Install muxchain with the Go module system using `go get stephens2424/muxchain`. Check the repository for the current installation instructions.

What category does muxchain belong to?

muxchain is listed under Web Frameworks, specifically Middlewares.

← Back to Middlewares