🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

github.com/jaswdr/go-http-mock-server

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/jaswdr/go-http-mock-server

v0.0.0-20170507204443-c662eb356699
Source
Go
Version published
Created
Source

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 jonathanschweder@gmail.com

License

MIT

FAQs

Package last updated on 07 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts