Common middlewares used in projects with go-chi. Just import necessary middlewares without reimplementation of them each time in a new project.
Add go-chi-middlewares as a dependency to your project
go get github.com/anfimovoleh/go-chi-middlewares
The code above fetches the go-chi-middlewares as your project dependency.
- Logger(zerolog);
- Basic Auth;
- Context(set objects to http request context);
- Verify remote address is private.
We are planning to add next middlewares in the near future:
- JWT Auth;
- OAuth2
- Rate limiter;
- Prometheus metrics.