Co-authored-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
parent
2da63654e5
commit
b035c02f78
155 changed files with 4279 additions and 5925 deletions
|
|
@ -10,6 +10,7 @@ todos_data = {
|
|||
"user1": ["Go for a run", "Read a book"],
|
||||
}
|
||||
|
||||
|
||||
class TodosResource(Resource):
|
||||
def get(self, username):
|
||||
todos = todos_data.get(username, [])
|
||||
|
|
@ -32,7 +33,8 @@ class TodosResource(Resource):
|
|||
|
||||
return {"error": "Invalid todo index"}, 400
|
||||
|
||||
api.add_resource(TodosResource, '/todos/<string:username>')
|
||||
|
||||
if __name__ == '__main__':
|
||||
api.add_resource(TodosResource, "/todos/<string:username>")
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(port=5003, debug=True)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue