Skip to main content

Endpoint

GET
/tasks
Retrieves all tasks from the database

Request

This endpoint does not require any parameters or request body.

Example Request

curl -X GET http://localhost:9999/tasks

Response

tasks
array
An array of task objects

Status Codes

200
OK
Successfully retrieved the list of tasks

Example Response

200 OK
[
  {
    "id": 1,
    "name": "Complete project documentation",
    "done": false,
    "createdAt": "2024-03-15T10:30:00.000Z",
    "updatedAt": "2024-03-15T10:30:00.000Z"
  },
  {
    "id": 2,
    "name": "Review pull requests",
    "done": true,
    "createdAt": "2024-03-14T09:15:00.000Z",
    "updatedAt": "2024-03-15T14:20:00.000Z"
  }
]

Implementation Details

This endpoint is defined in src/routes/tasks/tasks.routes.ts:11-21 and implemented in src/routes/tasks/tasks.handlers.ts:13-16. The response schema is validated using the selectTasksSchema from src/db/schema.ts:21, which is generated from the Drizzle ORM schema definition.

Build docs developers (and LLMs) love