generated from nighthawkcoders/flocker_backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
96 lines (87 loc) · 2.87 KB
/
app.py
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
from flask import Flask, jsonify
from flask_cors import CORS
# initialize a flask application (app)
app = Flask(__name__)
CORS(app, supports_credentials=True, origins='*') # Allow all origins (*)
@app.route('/api/avika')
def get_avika():
avika_info = [{
"FirstName": "Avika",
"LastName": "Prasad",
"DOB": "January 22",
"Residence": "San Diego",
"Email": "[email protected]",
"Favorite_Books": ["The Inheritance Games", "Harry Potter 1-7", "Mystiwick School of Musicraft", "The Hunger Games"]
}]
return jsonify(avika_info)
@app.route('/api/gabi')
def get_gabi():
gabi_info = [{
"FirstName": "Gabriela",
"LastName": "Connelly",
"DOB": "December 16",
"Residence": "San Diego",
"Email": "[email protected]",
"Favorite_Books": ["Made You Up", "The Cruel Prince", "Diary of a Wimpy Kid 1-19", "Legend"]
}]
return jsonify(gabi_info)
@app.route('/api/katherine')
def get_katherine():
katherine_info = [{
"FirstName": "Katherine",
"LastName": "Chen",
"DOB": "July 30",
"Residence": "San Diego",
"Email": "[email protected]",
"Favorite_Books": ["A Court of Thornes and Roses", "Talon", "49 Miles Alone", "They Both Die in the End", "The Silent Patient"]
}]
return jsonify(katherine_info)
@app.route('/api/soumini')
def get_soumini():
soumini_info = [{
"FirstName": "Soumini",
"LastName": "Kandula",
"DOB": "December 21",
"Residence": "Alaska",
"Email": "[email protected]",
"Favorite_Books": ["Harry Potter 1-7", "The Silent Patient", "A Good Girl's Guide to Murder", "Legend", "The Fault in Our Stars"]
}]
return jsonify(soumini_info)
@app.route('/api/aditi')
def get_aditi():
aditi_info = [{
"FirstName": "Aditi",
"LastName": "Bandaru",
"DOB": "May 21",
"Residence": "San Diego",
"Email": "[email protected]",
"Favorite_Books": ["A Feast for Crows", "Scythe", "A Game of Thrones", "Wings of Fires", "Frankenstein"]
}]
return jsonify(aditi_info)
@app.route('/api/maryam')
def get_maryam():
maryam_info = [{
"FirstName": "Maryam",
"LastName": "Abdul-Aziz",
"DOB": "November 23",
"Residence": "The Bermuda Triangle",
"Email": "[email protected]",
"Favorite Books": ["The Outsiders", "Tex", "The Catcher in the Rye", "The Hunger Games", "Renegades"]
}]
return jsonify(maryam_info)
@app.route('/')
def say_hello():
html_content = """
<html>
<head>
<title>Bookworms</title>
</head>
<body>
<h2>Hello, meet the team of the Bookworms!</h2>
</body>
</html>
"""
return html_content
if __name__ == '__main__':
# starts flask server on default port, http://127.0.0.1:5001
app.run(port=5001)