Mock your APIs in a really fast, robust and comprehensive way
go get github.com/jaschweder/go-http-mock-server
Create a mock.json
file like this:
{
"server":{
"address":"0.0.0.0",
"port":8080
},
"routes":[
{
"request":{
"method":"GET",
"url":"/hello"
},
"response":{
"status":200,
"body":"{\"message\": \"World!\"}"
}
}
]
}
Run gomock
:
$ gomock mock.json
Try make a request:
$ curl http://localhost:8080/hello
{message: "World!"}
That's it! You rock!!!
Issue report and PR's are welcome
Created by Jonathan A. Schweder jonathanschweder@gmail.com
MIT