Simple http stub server by golang
Only Go language
go get github.com/gostub/gostub
$ gostub -h
Usage of gostub:
-o string
output path (e.g. 'tests' -> ./tests)
-p string
port number (default "8181")
.
└── hello
└── world
├── $GET.json
└── response.json
$GET.json
{
"default" : {
"body": "response.json",
"status": 200
}
}
response.json
{
"hello": "world!"
}
launch
$ gostub
curl
$ curl http://localhost:8181/hello/world
{
"hello": "world!"
}
$ curl http://localhost:8181/gostub/shutdown