Documentation ¶
Overview ¶
Package main will explore the helpers for middleware(s) that Muxie has to offer, but they are totally optional, you can still use your favourite pattern to wrap route handlers.
Example of usage of an external net/http common middleware:
import "github.com/rs/cors"
mux := muxie.New() mux.Use(cors.Default().Handler)
To wrap a specific route or even if for some reason you want to wrap the entire router use the `Pre(middlewares...).For(mainHandler)` as :
wrapped := muxie.Pre(cors.Default().Handler, ...).For(mux) http.ListenAndServe(..., wrapped)
Click to show internal directories.
Click to hide internal directories.