Skip to content

A simple http mock server implemented by Golang.

License

Notifications You must be signed in to change notification settings

amooly/go-mocker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-mocker

A simple http mock server implemented by Golang.

How to Use

install

go get github.com/amooly/go-mocker

Start a Http Server

Firstly you need to create a json file to define the server config, just like this(You can also see the sample file here):

{
  "server": {
    "address": "0.0.0.0",
    "port": 8080
  },
  "routes": [
    {
      "request": {
        "method": "GET",
        "url": "/hello"
      },
      "response": {
        "status": 200,
        "body": "{\"message\": \"World!\"}"
      }
    }
  ]
}

After Then, run the command. The format of go-mocker command is :

go-mocker [{path_to_mock_file}]

You can define your own file using absolute path or relative path. Or it will use the sample file

Inspired by go-http-mock-server

About

A simple http mock server implemented by Golang.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages