This is simple todo list endpoint that I created with go language
- URL :
http://localhost:8080/api/v1/todos
- Method:
POST
- request body
{ "task": "Buy new macbook" }
- response
{ "status": "success", "code": 201, "message": "Successfully created new todo" }
- URL :
http://localhost:8080/api/v1/todos?id={id}
- Method:
PUT
- request body
{ "task": "Buy new monitor" }
- response
{ "status": "success", "code": 200, "message": "Successfully update todo" }
- URL :
http://localhost:8080/api/v1/todos?id={id}
- Method:
DELETE
- response
{ "status": "success", "code": 200, "message": "Successfully deleted todo" }
- URL :
http://localhost:8080/api/v1/todos
- Method:
GET
- response
{ "status": "success", "code": 200, "data": [ { "id": 2, "task": "Buy new macbook" }, { "id": 3, "task": "Buy new macbook" } ], "message": "List todo retrieved successfully" } `
- URL :
http://localhost:8080/api/v1/todos/detail/{id}
- Method:
GET
- response
{ "status": "success", "code": 200, "data": { "id": 3, "task": "Buy new macbook" }, "message": "Todo retrieved successfully" }