Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BearerMiddleware ¶
func BearerMiddleware(h httprouter.Handle, secret string) httprouter.Handle
func CorsMiddleware ¶
func CorsMiddleware(next httprouter.Handle) httprouter.Handle
CorsMiddleware defines a middleware for setting common CORS headers. This is useful when running backend and frontend on different ports. TODO: possibly make `Access-Control-Allow-Origin` more restrictive by returning a configurable list of hosts instead of *.
func CorsOptionsHandler ¶
func CorsOptionsHandler(w http.ResponseWriter, r *http.Request)
CorsOptionsHandler defines a global handler for HTTP OPTIONS requests.
func TokenMiddleware ¶
func TokenMiddleware(h httprouter.Handle, secret string) httprouter.Handle
Types ¶
Click to show internal directories.
Click to hide internal directories.