mathserver is a simple RESTful web service that serves up mathmetical computations. It uses the Flask framework to handle the incoming HTTP requests. At the present time, it includes the following functionality:
##Fibonacci Sequences
GET /fibonacci/n will return a Fibonacci sequence with n numbers, where n >e; 0.
Sequences are returned in XML format; see schemas/fibonacci.xsd for schema.
For negative values of n, a 403 Forbidden HTTP error code will be returned.
For Ubuntu: $ sudo apt-get install python-pip
$ sudo pip install flask
$ git clone https://github.com/chrissnell/mathserver.git
$ cd mathserver
$ python mathserver.py
$ curl -s http://localhost:5000/fibonacci/10
For Ubuntu:
$ sudo apt-get install libxml2-utils
From the mathserver top-level directory...
$ curl -s http://localhost:5000/fibonacci/10 | xmllint --noout --schema schemas/fibonacci.xsd -
This should produce the following output if the retured XML is valid:
- validates
With the server running, from the top-level directory...
$ curl -s http://localhost:5000/fibonacci/10 | python tests/validatefibbonaci.py
This should produce the following output if the returned Fibonacci sequence is valid:
Server returned 8 as the fifth Fibonacci number.
Fibonacci sequence validated.
- Caching of Fibonacci calculations
- Fancy, more descriptive error pages
- Write a performance test that feeds random Fibonacci number requests to
aband see it performs - Makefile to automate installation and testing