-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.py
executable file
·61 lines (50 loc) · 1.25 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
#!venv/bin/python
from flask import Flask, jsonify, request, render_template, redirect, url_for
app = Flask(__name__)
tasks = [
{
'id': 1,
'title': 'Prepare staff lecture',
'Priority': 10,
'completed': False
},
{
'id': 2,
'title': 'Complete 281 Project',
'Priority': 8,
'completed': False
}
]
@app.route('/')
def index():
# TODO: Redirect to all_tasks
return
@app.route('/create')
def create():
# TODO: Redirect to form to create a task
return
@app.route('/api/v1/tasks')
def all_tasks():
# TODO: Retrieve all tasks
return
@app.route('/api/v1/tasks/<id>', methods=['GET'])
def get_task(id):
return
@app.route('/api/v1/create', methods=['GET','POST'])
def create_task():
# TODO: Create event and append to dictionary
return
@app.route('/api/v1/tasks/<id>', methods=['DELETE'])
def delete_task(id):
# TODO: Remove a task with the specified ID
return
@app.route('/api/v1/tasks/<id>', methods=['PUT'])
def update_task(id):
# TODO: Update a task with the specified ID
return
@app.route('/api/v1/tasks/<id>', methods=['POST'])
def mark_complete(id):
# TODO: Wrapper for DELETE
return
if __name__ == '__main__':
app.run(debug=True)