AirBnB_clone_v2
AirBnB_clone_v2 copied to clipboard
Implement storage methods, API endpoints, CORS configuration, and error handling
PR Description:
This pull request introduces several new features and enhancements to the project:
-
Adding method to get items from storage and to count items: This feature adds a new method to retrieve items from the storage and to count the number of items that exists within the storage. This functionality enhances the usability of the application by allowing users to access and manage stored data more efficiently.
-
Setting API Endpoints (/status, /stats, /states): This update includes the implementation of three new API endpoints:
-
/status
: Provides information about the status of the API. -
/stats
: Returns the number of objects stored in the storage categorized by type. -
/states
: Handles all default RESTful actions for State Objects, providing CRUD operations for managing State data. -
/cities
: Handles all default RESTful actions for City Objects, providing CRUD operations for managing City data. -
/places
: Handles all default RESTful actions for Place Objects, providing CRUD operations for managing Place data. -
/amenities
: Handles all default RESTful actions for Amenity Objects, providing CRUD operations for managing Amenity data. -
/users
: Handles all default RESTful actions for User Objects, providing CRUD operations for managing User data. -
/reviews
: Handles all default RESTful actions for Review Objects, providing CRUD operations for managing Review data.
-
-
CORS Configuration: Additionally, this PR includes the configuration of Cross-Origin Resource Sharing (CORS) to allow secure communication between the client-side and server-side components of the application. CORS configuration helps prevent security vulnerabilities and ensures seamless data exchange.
-
Handling 404 Errors: A new method is added to handle 404 errors, improving error handling and user experience by gracefully managing situations where requested resources are not found.
These changes aim to enhance the functionality, performance, and security of the project, aligning with the project's objectives and requirements.
Please review the changes and provide any feedback or suggestions. Thank you.