-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathapp.py
More file actions
36 lines (31 loc) · 748 Bytes
/
app.py
File metadata and controls
36 lines (31 loc) · 748 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
from flask import Flask
from datetime import datetime
app = Flask(__name__)
data = {
"drinks": [
{
"name": "Grape",
"description": "Delicious grape fruit drink",
"date": datetime.now()
},
{
"name": "Lemon",
"description": "Undiluted lemon fruit drink",
"date": datetime.now()
},
{
"name": "Mango",
"description": "This is a mango fruit",
"date": datetime.now()
}
]
}
@app.route("/")
def index():
return "Welcome To My Drinks API"
@app.route('/drinks')
def get_drinks():
return data
if __name__ == "__main__":
app.debug = True
app.run()