This document provides an overview of the endpoints available in the API.
app/
├── models/
│ ├── Task.js
│ └── User.js
└── routes/
├── auth.js
└── tasks.js
└── user.js
util/
└── index.js
└── mongoose.js
└── passport.js
Returns information about a specific task.
GET /api/v1/tasks/:id
Parameter | Description |
---|---|
id | The ID of the task. |
{
"Text": "Example Task",
"Done": false,
"Date": "2024-03-20T12:00:00Z"
}
{
"_id": "609e40dbb49e5e0015dbf4f0",
"UserId": "123456789",
"Text": "Example Task",
"Done": false,
"Date": "2024-03-20T12:00:00Z"
}
Creates a new task.
POST /api/v1/tasks/
{
"Text": "New Task",
"Date": "2024-03-21T10:00:00Z"
}
{
"_id": "609e40dbb49e5e0015dbf4f0",
"UserId": "123456789",
"Text": "New Task",
"Done": false,
"Date": "2024-03-21T10:00:00Z"
}
Updates an existing task.
PUT /api/v1/tasks/:id
Parameter | Description |
---|---|
id | The ID of the task. |
{
"Text": "Updated Task",
"Done": true
}
{
"_id": "609e40dbb49e5e0015dbf4f0",
"UserId": "123456789",
"Text": "Updated Task",
"Done": true,
"Date": "2024-03-21T10:00:00Z"
}
Deletes an existing task.
DELETE /api/v1/tasks/:id
Parameter | Description |
---|---|
id | The ID of the task. |
"Task deleted successfully"
Initiates authentication via Google OAuth 2.0.
GET /api/v1/auth/google
Redirects to Google OAuth consent screen.
Handles the callback from Google OAuth 2.0.
GET /api/v1/auth/google/callback
Redirects to the client application.
Logs out the user.
GET /api/v1/auth/logout
Redirects to the client application.
Returns information about the authenticated user.
GET /api/v1/user
{
"Id": "123456789",
"Email": "user@example.com",
"UserName": "user"
}