RPN is a web server that can parse reverse polish notation string and then write result as JSON format.
These instructions will get you a copy of the RPN up and running on your local machine.
golang:1.10
go get github.com/gorilla/mux
go get github.com/golang-collections/collections/stack
go get github.com/jessevdk/go-flags
Run the go unit test
make test
make build
make build-linux
make clean
make docker-build
make docker-run
curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"rpns":[{"input":"10 -1 +"},{"input":"10 -2 +"}]}' http://localhost:8080/parse
curl -H "Accept: application/json" -H "Content-type: application/json" -X GET http://localhost:8080/health
This api recieves single reverse polish notation string as input and return result as JSON format.
{
"rpns": [{
"input": "10 -1 +"
},
{
"input": "10 -2 +"
}
]
}
{
"rpn": [
{
"name": "10 -1 +",
"result": 9
},
{
"name": "10 -2 +",
"result": 8
}
]
}
This api helps load balancer check the server's healty situation
N/A
{
"status": "OK",
"code": 200
}