gjuliao / car_app_backend

This is the back end for the car app.
MIT License
0 stars 3 forks source link

Add Cars Endpoint. #24

Closed paulsaenzsucre closed 1 year ago

paulsaenzsucre commented 1 year ago

Add Cars Endpoint.

These are the proposed changes for this pull request:

:pushpin: We implement the api endpoints routes.

:pushpin: We implement RESTFUL /api/v1/cars endpoint, the user can do GET and POST requests.

:pushpin: We implement RESTFUL /api/v1/cars/:id endpoint, the user can do GET, PUT, and DELETE requests.

:pushpin: We proposed a standard response from api:

{
  "errors": false,
  "message_code": "founded",
  "message": "Car founded",
  "payload": {
    "id": 3,
    "model": "Mustang",
    "image": "https://www.someurl.jpeg",
    "price": "32500.0",
    "brand": "Ford",
    "year": "2021-01-01",
    "color": "Red",
    "accidents": 1,
    "rented": true,
    "electric": false
  }
}

If the request were successful, you have "errors" = false otherwise it would be "errors" = true and inside payload you have the resource requested to the API if any.

Requests templates:

image

image

image

image

image