File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 44from flask .json import jsonify
55from flask import request
66from app .FileDelegate import FileDelegate
7+ from app .recipe import Recipe
78
89
910@app .route ('/' , methods = ['GET' ])
1011@app .route ('/status' )
1112def index ():
12- response = {'status' : "OK" , 'Time' : datetime .datetime .now (), 'project' : 'recipes' }
13+ response = {'status' : "OK" , 'Time' : datetime .datetime .now (),
14+ 'project' : 'recipes' }
1315 return jsonify (response )
1416
1517
@@ -25,7 +27,10 @@ def searchByTagsAll():
2527
2628@app .route ("/search/all" , methods = ['GET' ])
2729def getAll ():
28- return jsonify ("{}" )
30+ recipes = Recipe .query .all ()
31+ toJson = list (map ((lambda r : r .toJson ()), recipes ))
32+ return jsonify (toJson )
33+
2934
3035
3136@app .route ("/search/ByIngredients" , methods = ['GET' ])
You can’t perform that action at this time.
0 commit comments