Skip to content

davidp-ro/curs-flutter-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

curs-flutter-api

REST API used to teach a Flutter course, deployed on heroku here.

Endpoints

{
  "status": "ok / fail",
  "error": "null / an error",
  "data": [
    ...,
    {
      "id": "sneaker_id",
      "brand": "Sneaker Brand, ie: adidas (all lowercase, no spaces)",
      "name": "The sneaker's model / display name",
      "price": "The sneaker's price",
      "image": "image_link"
    },
    ...
  ]
}
{
  "status": "ok / fail",
  "error": "null / an error",
  "data": {
    "id": "sneaker_id",
    "brand": "Sneaker Brand, ie: adidas (all lowercase, no spaces)",
    "name": "The sneaker's model / display name",
    "price": "The sneaker's price",
    "image": "image_link",
    "desc": "Brand's description for this sneaker",
    "url": "Official page link"
  }
}
Request Body:

{
  "brand": "Sneaker Brand, ie: adidas (all lowercase, no spaces)",
  "name": "The sneaker's model / display name",
  "price": "The sneaker's price",
  "desc": "Brand's description for this sneaker",
  "url": "Official page link"
}

Response:

{
  "status": "ok / fail",
  "error": "null / an error",
  "data": "The newly added sneaker's ID"
}
  • Note: data will be null if there's an error!

Populating .ENV

ADMIN_SDK_CREDS=<admin sdk credentials (b64 encoded)>
PORT=<port where to run the api>
ALLOW_ADDING=<allow POST /sneaker>

License

MIT - View

All images / products referenced in this project are the porperties of their respective owners.