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 4
4
from flask .json import jsonify
5
5
from flask import request
6
6
from app .FileDelegate import FileDelegate
7
+ from app .recipe import Recipe
7
8
8
9
9
10
@app .route ('/' , methods = ['GET' ])
10
11
@app .route ('/status' )
11
12
def index ():
12
- response = {'status' : "OK" , 'Time' : datetime .datetime .now (), 'project' : 'recipes' }
13
+ response = {'status' : "OK" , 'Time' : datetime .datetime .now (),
14
+ 'project' : 'recipes' }
13
15
return jsonify (response )
14
16
15
17
@@ -25,7 +27,10 @@ def searchByTagsAll():
25
27
26
28
@app .route ("/search/all" , methods = ['GET' ])
27
29
def getAll ():
28
- return jsonify ("{}" )
30
+ recipes = Recipe .query .all ()
31
+ toJson = list (map ((lambda r : r .toJson ()), recipes ))
32
+ return jsonify (toJson )
33
+
29
34
30
35
31
36
@app .route ("/search/ByIngredients" , methods = ['GET' ])
You can’t perform that action at this time.
0 commit comments