Skip to content

oktalz/go-web-simple

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-web-simple

Simple web server that returns unique id as response, useful for load balancing tests

Usage

go run main.go

Docker image is available on Github: docker.pkg.github.com/oktalz/go-web-simple/srv:latest

To pull image use docker pull docker.pkg.github.com/oktalz/go-web-simple/srv:latest

If you prefer to build it from source use

docker build -t go-web-simple .

Options

You can define environment variable GROUP. json response displays that variable in response

Responses

Normal

$ curl 'http://127.0.0.1:8181/id'
01DP16R5EB12YNDT8XN5K66WBY
$ curl 'http://127.0.0.1:8181/'
{"group":"","id":"01DP16R5EB12YNDT8XN5K66WBY","timestamp":1569851434267487746,"url":"/"}

In case of export GROUP="beta"

$ curl 'http://127.0.0.1:8181/' 
{"group":"beta","id":"01DP17A7VDE2452MCH66SK38JY","timestamp":1569851779543149525,"url":"/"}

About

Simple web server that returns unique id as response, usefull for load balancing tests

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors