/middleware

personal collection of go middleware

Primary LanguageGo

middleware

Just a collection of middlewares that i use from time to time.
better to have them here all together.

Lowercase

turns the path to lowercase, sometimes is useful to make no distintion between /blog/posts and /Blog/Posts.

CORS

cors allow everything, useful for debugging (use https://github.com/rs/cors for prod please).

JSONContentType

sets the Content-Type header to application/json

BasicAuth

simple basic auth middleware, pass handler and a string in the format of user:password, only supports 1 user.