-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
52 lines (37 loc) · 756 Bytes
/
app.py
File metadata and controls
52 lines (37 loc) · 756 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
from flask import Flask, render_template, jsonify, request
app = Flask (__name__)
STRAINS = [
{
'id':1,
'title': 'White Widow',
'type': 'Indica',
'effects': 'sedative'
},
{
'id':2,
'title': 'Grand Daddy Purp (GDP)',
'type': 'Indica',
'effects': 'sedative'
},
{
'id':3,
'title': 'OG',
'type': 'Indica',
'effects': 'sedative'
},
{
'id':4,
'title': 'Gelato 41',
'type': 'Indica',
'effects': 'sedative'
}
]
@app.route("/")
def hello_world():
return render_template('home.html',
strains=STRAINS)
@app.route("/api/strains")
def list_strains():
return jsonify(STRAINS)
if __name__ == "__main__":
app.run(host='0.0.0.0', debug=True)