A simple HTTP server which, given one fibonacci number, produces the next
- latest go version
${GOPATH}/bin
must be in your$PATH
The following will install gofib-server in ${GOPATH}/bin
go install github.com/uberblah/gofib-server
The following will serve over HTTP on localhost:8080/fib/
gofib-server
# should print 3
curl localhost:8080/fib/?n=2
# should print 5
curl localhost:8080/fib/?n=3
# should print an error indicating that 4 is not a fibonacci number
curl localhost:8080/fib/?n=4
# starts the server, reachable at 192.168.0.13:8080/fib/
GOFIB_ADDR=192.168.0.13:8080 gofib-server
# starts the server, reachable at localhost:8080/fibonoid/
GOFIB_PATH=/fibonoid/ gofib-server
# starts the server, reachable at 192.168.0.13:8080/fibonoid/
GOFIB_ADDR=192.168.0.13:8080 GOFIB_PATH=/fibonoid/ gofib-server