Sign inSign up

jaschweder/go-http-mock-server

By jaschweder

Updated over 9 years ago

Mock your APIs in a really fast, robust and comprehensive way

Image
0

426

jaschweder/go-http-mock-server repository overview

Go http mock server

Mock your APIs in a really fast, robust and comprehensive way

Install

go get github.com/jaschweder/go-http-mock-server

Getting start

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!!!

How to contribute:

Issue report and PR's are welcome

Author:

Created by Jonathan A. Schweder [email protected]

License

MIT

Tag summary

Content type

Image

Digest

Size

74.2 MB

Last updated

over 9 years ago

docker pull jaschweder/go-http-mock-server