Skip to content
A simple quote server
Python HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


A simple quote server

This is a simple Flask application that reads a directory of fortune files and serves a random quote. It provides a simple HTTP REST interface, defaults to ASCII text output for use in shell scripts, supports JSON or HTML output for integration with external applications.


Local Operation - Development/Testing

$ git clone [url]
$ cd qsrv_func
$ export
$ export FLASK_ENV=development
$ flask run

Point your browser at http://localhost:5000/ for the home page, or append one of the routes below for a fortune.

To Do: include some product deployment instructions

API Usage:

Send an HTTP GET to the desired URI.

Returns API information and usage.
(not yet implemented)
Returns a random fortune from all available fortune databases.
Returns a fortune from the selected database.
List all fortunes in database


Get random fortune from terminal:
curl http://localhost:5000/api/fortune/random
Select fortune from THE MIGHTY MONARCH! fortune file:
curl http://localhost:5000/api/fortune/the-mighty-monarch

To Do:

  • Add JSON and HTML outputs
You can’t perform that action at this time.