Setup:
- Create a directory
mkdir -p $HOME/go/src/github.com/vineet-garg
cd $HOME/go/src/github.com/vineet-garg
- Clone the repo
git clone https://github.com/vineet-garg/assignment-1.git
- step into the directory
cd assignment-1
- build
go build
- start the server
./assignment-1
- sample APIs:
curl -X POST http://localhost:8080/hash -d "password=angryMonkey"
1
curl -XGET http://localhost:8080/hash/1
ZEHhWB65gUlzdVwtDQArEyx+KVLzp/aTaRaPlBzYRIFj6vjFdqEb0Q5B8zVKCZ0vKbZPZklJz0Fd7su2A+gf7Q==
curl -X GET http://localhost:8080/stats
{"average":19,"total":1}
curl -X POST http://localhost:8080/shutdown
- stop the server using HTTPS request as above or
~c