Skip to content

Wildhoney/Recipes

Repository files navigation

Learn Recipes

Base Python API for a series of on-going recipe learning projects in various front-end frameworks.

Flavours

Getting Started

Initiate the virtualenv environment:

virtualenv env
source env/bin/activate

Once you have your virtual environment installed, you can use pip to install the dependencies:

pip install -r requirements.txt

Followed by the starting of the server on port 5000 – ensure that it is executable (with chmod +x run_server.sh):

./run_server.sh

Note that the base Python API uses MongoDB – it attempts to parse the environment variable MONGOHQ_URL, but failing that will attempt to connect to localhost on port 27017. If you'd like to specify the MongoDB credentials then you can export the MONGOHQ_URL environment variable:

export MONGOHQ_URL=mongodb://myUsername:myPassword@myHost:myPort/myDBName

API Endpoints

Read:

curl -i http://localhost:5000/recipes
     -X GET

Create:

curl -i http://localhost:5000/recipes
     -X POST
     -H "Content-Type: application/json"
     -d '{"name":"Banana Cake","description":"Delectable banana cake!","ingredients":["Banana","Flour"]}'

Delete:

Assume that 123456789 is the model's primary key in MongoDB.

curl -i http://localhost:5000/recipes/123456789
     -X DELETE

About

Base Python API for a series of on-going "Learn" projects in various front-end frameworks.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors