- it is a recipe API built in Python using data from MySQL and user's input
- it extracts recipes from MySQL database into URL, where you can filter recipes by cuisine type
- it asks user if they would like to add a new recipe into database and if so it adds it into URL and MySQL database
- programmes you need to run this applicaton:
- Python software,
- editor to run the code, eg. PyCharm,
- interpreter for the MYSQL language MySQL Community Server,
- application to see database data. e.g. MySQL WorkBench
- in order to work with MySQL database you need to add your credentials into
config.pyfile
-
open Pycharm and run
app.py; the URL is located in result window (http://127.0.0.1:5000); -
click on url which takes you to the homepage;
-
add an endpoint 'recipes' to the url and you will be able to see all recipes from MySQL database project_4, table recipes (there are 4 recipes);
-
you can filter recipes by cuisine type by using endpoint
.../recipes/<cuisine type>(options based on recipes in MySQL database are american, middle eastern, central europe) -
go back to Pycharm and in terminal navigate into the folder
assignment-4-build-APIand type 'python main.py', you will be greeted with welcome message and a list of all recipes in the database -
when asked if you want to add a recipe type 'y' and answer questions regarding a new recipe you want to add
-
at this point a new recipe has been added to the URL and MySQL database;