-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
We need to create a new API endpoint that returns a random verse from the database. This will allow users to fetch a different verse each time they hit the endpoint.
Requirements
- Create a new route: GET
/api/verses/random - Query the database to fetch a random verse (Prisma ORM)
- Return the verse in a structured JSON response, e.g.:
{
"id": "39fbbe93-8678-474e-b1ad-2dee322ae676",
"book": "Salmos",
"chapter": "23",
"verse": "1",
"content": "O Senhor é o meu pastor, nada me faltará",
"author": "Davi"
}- Ensure the endpoint handles cases where no verses exist in the database
Tasks
- Implement the GET
/api/verses/random route - Add the database query to fetch a random verse
- Structure the response correctly
- Handle potential errors (e.g., empty database)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers