Joke API Server

A backend implementation to support Qu Code Challenge frontend app.


Features



API Endpoints

Method 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.


Example Payload

{
  "id": 101,
  "type": "programming",
  "setup": "Why do programmers prefer dark mode?",
  "punchline": "Because light attracts bugs.",
  "rating": 2
}