Your D1 Database contains the following data:
> SELECT * FROM comments LIMIT 3;
[
{
"id": 1,
"author": "Kristian",
"body": "Great post!",
"post_slug": "hello-world"
},
{
"id": 2,
"author": "Serena",
"body": "Keep up the good work.",
"post_slug": "hello-world"
},
{
"id": 3,
"author": "Max",
"body": "Thanks for the great writeup.",
"post_slug": "tutorial-123"
}
]
Build a comments API with Workers and D1