andres-martin / airbnb_clone_v3 Goto Github PK
View Code? Open in Web Editor NEWThis project forked from alexaorrico/airbnb_clone_v2
This project forked from alexaorrico/airbnb_clone_v2
Designers are really creative when they have to design a “404 page”, a “Not found”… 34 brilliantly designed 404 error pages
Today it’s different, because you won’t use HTML and CSS, but JSON!
In api/v1/app.py, create a handler for 404 errors that returns a JSON-formatted 404 status code response. The content should be: "error": "Not found"
Create a folder api at the root of the project with an empty file init.py
Create a folder v1 inside api
create this endpoint http://0.0.0.0:5000/api/v1/status
Create a new view for state
Nothing better than writing tests… and documentation!
Create a new view for Place objects that handles all default RestFul API actions:
In the file api/v1/views/places.py
You must use to_dict() to retrieve an object into a valid JSON
Update api/v1/views/init.py to import this new file
Retrieves the list of all Place objects of a City: GET /api/v1/cities/<city_id>/places
If the city_id is not linked to any City object, raise a 404 error
Retrieves a Place object. : GET /api/v1/places/<place_id>
If the place_id is not linked to any Place object, raise a 404 error
Deletes a Place object: DELETE /api/v1/places/<place_id>
If the place_id is not linked to any Place object, raise a 404 error
Returns an empty dictionary with the status code 200
Creates a Place: POST /api/v1/cities/<city_id>/places
You must use request.get_json from Flask to transform the HTTP request to a dictionary
If the city_id is not linked to any City object, raise a 404 error
If the HTTP request body is not valid JSON, raise a 400 error with the message Not a JSON
If the dictionary doesn’t contain the key user_id, raise a 400 error with the message Missing user_id
If the user_id is not linked to any User object, raise a 404 error
If the dictionary doesn’t contain the key name, raise a 400 error with the message Missing name
Returns the new Place with the status code 201
Updates a Place object: PUT /api/v1/places/<place_id>
If the place_id is not linked to any Place object, raise a 404 error
You must use request.get_json from Flask to transform the HTTP request to a dictionary
If the HTTP request body is not valid JSON, raise a 400 error with the message Not a JSON
Update the Place object with all key-value pairs of the dictionary
Ignore keys: id, user_id, city_id, created_at and updated_at
Returns the Place object with the status code 200
Create a new view for the link between Place objects and Amenity objects that handles all default RestFul API actions:
Create a new view for Review object that handles all default RestFul API actions
Same as State, create a new view for City
Update api/v1/views/places.py to add a new endpoint: POST /api/v1/places_search that retrieves all Place objects depending of the JSON in the body of the request.
Create an endpoint that retrieves the number of each objects by type
Currently, the User object is designed to store the user password in cleartext.
Create a new view for Amenity objects that handles all default RestFul API actions:
In the file api/v1/views/amenities.py
You must use to_dict() to serialize an object into valid JSON
Update api/v1/views/init.py to import this new file
Create a new view for User object that handles all default RestFul API actions:
In the file api/v1/views/users.py
You must use to_dict() to retrieve an object into a valid JSON
Update api/v1/views/init.py to import this new file
A resource makes a cross-origin HTTP request when it requests a resource from a different domain, or port, than the one the first resource itself serves.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.