-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
39 lines (24 loc) · 688 Bytes
/
app.py
File metadata and controls
39 lines (24 loc) · 688 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
import flask
from controllers import health
from controllers import contacts
app = flask.Flask(__name__)
app.config["DEBUG"] = True
@app.route('/', methods=['GET'])
def health():
return health.hello()
@app.route('/contacts', methods=['POST'])
def create():
return contacts.create()
@app.route('/contacts/<id>', methods=['PUT'])
def update(id):
return contacts.update(id)
@app.route('/contacts/<id>', methods=['DELETE'])
def delete(id):
return contacts.delete(id)
@app.route('/contacts', methods=['GET'])
def get_list():
return contacts.lists()
@app.route('/contacts/<id>', methods=['GET'])
def get_details(id):
return contacts.details(id)
app.run()