Skip to content

Commit

Permalink
Merge pull request #15 from friendsofgo/allow_cors
Browse files Browse the repository at this point in the history
Fixes #14. Allow CORS requests
  • Loading branch information
aperezg authored May 7, 2019
2 parents 54242b6 + 6672faf commit b9b49fb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@
* Dynamic responses based on query params
* Allow organize your imposters with structured folders (using new extension `.imp.json`)
* Allow write multiple imposters by file

## v0.3.1 (2019/05/07)

* Allow CORS requests
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 b9b49fb

Please sign in to comment.