This is a simple flask app with a very simple json api
It keeps count of words PUT It displays the count of all words or a specific word via GET
/words - list all words and counts /word/ - GET word count or PUT word
Examples:
curl -XPUT http://localhost:5000/word/chicken -d'{"word":"chicken"}'
{
"okay": "true"
}
curl -XGET http://localhost:5000/words
{
"chicken": 12,
"taco": 2
}
curl -XGET http://localhost:5000/word/taco
{
"taco": 2
}
This was built with Python 2.6.6
Install pip requirements
$>virtualenv env
$>. env/bin/activate
$>pip install -r requirements.txt
Init DB
$>. env/bin/activate
$>python
>>>from words import init_db
>>>init_db()
$>. env/bin/activate
$>python app.py
You can interact with the API on localhost:5000
TODO:
- supervisor install instructions
- supervisor config to run this as daemon
Reference Automation Challenges