Skip to content

Commit

Permalink
Fixes #14. Allow CORS requests
Browse files Browse the repository at this point in the history
  • Loading branch information
aperezg committed May 7, 2019
1 parent 54242b6 commit 093c631
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/killgrave/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"net/http"

killgrave "github.com/friendsofgo/killgrave/internal"
"github.com/gorilla/handlers"
"github.com/gorilla/mux"
)

Expand Down Expand Up @@ -36,5 +37,5 @@ func main() {

httpAddr := fmt.Sprintf("%s:%d", *host, *port)
log.Printf("The fake server is on tap now: http://%s:%d\n", *host, *port)
log.Fatal(http.ListenAndServe(httpAddr, r))
log.Fatal(http.ListenAndServe(httpAddr, handlers.CORS()(r)))
}
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module github.com/friendsofgo/killgrave
go 1.12

require (
github.com/gorilla/handlers v1.4.0
github.com/gorilla/mux v1.7.1
github.com/pkg/errors v0.8.1
github.com/stretchr/testify v1.3.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/gorilla/handlers v1.4.0 h1:XulKRWSQK5uChr4pEgSE4Tc/OcmnU9GJuSwdog/tZsA=
github.com/gorilla/handlers v1.4.0/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ=
github.com/gorilla/mux v1.7.1 h1:Dw4jY2nghMMRsh1ol8dv1axHkDwMQK2DHerMNJsIpJU=
github.com/gorilla/mux v1.7.1/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
Expand Down

0 comments on commit 093c631

Please sign in to comment.