A backend implementation to support Qu Code Challenge frontend app.
rating
property (scale: 0-3
)GET
jokesPOST
new jokesPUT
updatesDELETE
single or all jokesMethod | Route | Description |
---|---|---|
GET | /api/jokes |
Fetches all jokes (remote if empty) |
POST | /api/jokes |
Adds a new joke |
PUT | /api/jokes/:id |
Updates a joke by ID |
DELETE | /api/jokes/:id |
Deletes a joke by ID |
DELETE | /api/jokes |
Deletes all jokes |
All jokes are enriched with a rating
field of type 0 | 1 | 2 | 3
.
{
"id": 101,
"type": "programming",
"setup": "Why do programmers prefer dark mode?",
"punchline": "Because light attracts bugs.",
"rating": 2
}