Simple http stub server by golang
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
models
.gitignore
README.md
gostub.go
gostub.png
main.go

README.md

gostub

Simple http stub server by golang

gostub

Requirement

Only Go language

Installation

go get github.com/gostub/gostub

Usage

$ gostub -h

Usage of gostub:
  -o string
    	output path (e.g. 'tests' -> ./tests)
  -p string
    	port number (default "8181")

Example

Add route GET /hello/world

.
└── hello
    └── world
        ├── $GET.json
        └── response.json

$GET.json

{
  "default" : {
    "body": "response.json",
    "status": 200
  }
}

response.json

{
  "hello": "world!"
}

Response

launch

$ gostub

curl

$ curl http://localhost:8181/hello/world

{
  "hello": "world!"
}

Shutdown

$ curl http://localhost:8181/gostub/shutdown