Skip to content

Commit ba39166

Browse files
committed
feat: updating todo endpoints get and post
1 parent 23e7092 commit ba39166

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ cd layered-flask-todo-service/
2828
2. Build and run the app using Docker Compose:
2929

3030
```bash
31-
docker-compose up --build
31+
docker-compose up
3232
```
3333
This command will build the Docker images and start the containers for the TODO App and its associated services (e.g., the database).
3434

app/api/v1/resources/todo.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
logger = logging.getLogger(__name__)
66

7-
api = Namespace('todos', description='TODO operations')
7+
api = Namespace('/', description='TODO operations')
88

99
todo_model = api.model('TODO', {
1010
'id': fields.Integer(readonly=True, description='The unique identifier of the todo'),
@@ -21,7 +21,7 @@
2121
todo_parser.add_argument('status', type=str, default='todo')
2222

2323

24-
@api.route('/<int:todo_id>')
24+
@api.route('todo/<int:todo_id>')
2525
class TodoResource(Resource):
2626
@api.doc('get_todo')
2727
@api.marshal_with(todo_model)
@@ -67,7 +67,7 @@ def delete(self, todo_id):
6767
return {"message": "An error occurred while deleting the TODO"}, 500
6868

6969

70-
@ api.route('/')
70+
@ api.route('/todo')
7171
class TodoListResource(Resource):
7272
@ api.doc('list_todos')
7373
@ api.marshal_list_with(todo_model)

todo.png

-146 KB
Loading

0 commit comments

Comments
 (0)