This document describes the API endpoints available in our application.
Get Users
Endpoint:/api/users
Method:GET
Description: Fetches all users from the database.
Response: A JSON object with the following properties:
status: A string that indicates the status of the request. This will be 'Connected' if the request was successful.
users: An array of user objects. Each object contains the properties of a user.
Example Response:
{
"status": "Connected",
"users": [
{
"id": 1,
"name": "John Doe",
"email": "john@example.com"
},
{
"id": 2,
"name": "Jane Doe",
"email": "jane@example.com"
}
]
}
Error Response: If there's an error (for example, if the database connection is refused), the API will return a JSON object with the following properties:
status: A string that indicates the status of the request. This will be 'Error' if there was an error.
error: A string that describes the error.
Example Error Response:
{
"status": "Error",
"error": "Database connection refused"
}
API Documentation
This document describes the API endpoints available in our application.
Get Users
Endpoint:
/api/users
Method:
GET
Description: Fetches all users from the database.
Response: A JSON object with the following properties:
status
: A string that indicates the status of the request. This will be 'Connected' if the request was successful.users
: An array of user objects. Each object contains the properties of a user.Example Response: