Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Endpoint that retrieves the number of each objects by type #4

Open
hima890 opened this issue Aug 2, 2024 · 0 comments
Open

Endpoint that retrieves the number of each objects by type #4

hima890 opened this issue Aug 2, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@hima890
Copy link
Owner

hima890 commented Aug 2, 2024

Create an endpoint that retrieves the number of each objects by type:

In api/v1/views/index.py
Route: /api/v1/stats
You must use the newly added count() method from storage
guillaume@ubuntu:/AirBnB_v3$ curl -X GET http://0.0.0.0:5000/api/v1/stats
{
"amenities": 47,
"cities": 36,
"places": 154,
"reviews": 718,
"states": 27,
"users": 31
}
guillaume@ubuntu:
/AirBnB_v3$
(No need to have a pretty rendered output, it’s a JSON, only the structure is important)

@hima890 hima890 added the enhancement New feature or request label Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants