gostub / gostub

Simple http stub server by golang

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Simple http stub server by golang


Languages

Language:Go 100.0%