testgin is a gin based api gateway.
{
"db":{
"name": "mysql",
"user": "root",
"password": "1234",
"ip": "127.0.0.1",
"port": 3306,
"table":"test"
},
"etcd":{
"ip": "127.0.0.1",
"port": 2379
},
"serverA":{
"ip": "127.0.0.1",
"port": 1701
}
}
For example, your config file is $GOPATH/src/github.com/xujintao/config/config.json
Run from source directly
$ go get -u github.com/xujintao/testgin
$ cd $GOPATH/src/github.com/xujintao/testgin
$ go build
$ ./testgin $GOPATH/src/github.com/xujintao/config/config.json
or run from docker
docker run --rm \
-it \
-p 8080:8080 \
-v $GOPATH/src/github.com/xujintao/config:/etc/testgin \
xujintao/testgin:1.0.49 \
/etc/testgin/config.json
more tags: https://hub.docker.com/r/xujintao/testgin/tags/
Open chrome, press F12, then visit http://172.0.0.1:8080