My Todo App(Next.js 14)
已新增一個可直接在本機使用的「後台資料庫」:
- 儲存位置:
data/todos.json - 後端 API:
/api/todos - 支援操作:查詢、新增、更新、刪除
curl http://localhost:3000/api/todoscurl -X POST http://localhost:3000/api/todos \
-H 'Content-Type: application/json' \
-d '{"title":"寫測試"}'curl -X PATCH 'http://localhost:3000/api/todos?id=<todo_id>' \
-H 'Content-Type: application/json' \
-d '{"completed":true}'curl -X DELETE 'http://localhost:3000/api/todos?id=<todo_id>'