Fix Codacy issues

This commit is contained in:
Anders Roos 2022-11-15 13:34:40 +01:00
parent 5645cd23fe
commit 741f315f14
19 changed files with 163 additions and 135 deletions

View file

@ -23,6 +23,7 @@ func New(token string) *API {
}
}
// EnableCors is a middleware that enables CORS for the API
func (api *API) EnableCors(fn http.HandlerFunc) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
w.Header().Add("Access-Control-Allow-Origin", "*")