https://foodiefunbw.herokuapp.com/
HTTP Method: [POST]
URL: /api/auth/register
Schema:
| Name | Type | Required | description |
|---|---|---|---|
| username | string | yes | unique username |
| password | string | yes | password |
| string | yes | unique email | |
| location | string | yes | string |
Example
{
"username": "EthanHoover0",
"password": "123",
"email": "ethanhoovernamename@gmail.com",
"location": "Las Vegas"
}
The returned object will be:
{
"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IkV0aGFuSG9vdmVyMCIsImlhdCI6MTU4MDc5MTkxOCwiZXhwIjoxNTgwODc4MzE4fQ.lw7pcQD_JXyhI4NOL1TjjMbUiggNs-ShFhWWfhk7xlU",
"message": "Welcome EthanHoover0"
}
HTTP Method: [POST]
URL: /api/auth/login
Schema:
| Name | Type | Required | description |
|---|---|---|---|
| username | string | yes | unique username |
| password | string | yes | password |
Example
{
"username": "EthanHoover0",
"password": "123"
}
The returned object will be:
{
"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IkV0aGFuSG9vdmVyMCIsImlhdCI6MTU4MDc5MTkxOCwiZXhwIjoxNTgwODc4MzE4fQ.lw7pcQD_JXyhI4NOL1TjjMbUiggNs-ShFhWWfhk7xlU",
"message": "Welcome back EthanHoover0!"
}
HTTP Method: [POST]
URL: /api/reviews
Must be validated user with token
Schema:
| Name | Type | Required | description |
|---|---|---|---|
| menu_item | string | yes | name of item from menu |
| item_price | integer | yes | price of item |
| item_rating | integer | yes | number rating of item |
| restaurant_id | integer | yes | the id given to a restaurant |
| item_review | string | yes | review of item |
| item_image_url | string | yes | picture of item in jpg form |
| date_visited | date | yes | date of visitation |
Example
{
"menu_item": "burrito",
"item_price": 6.50,
"item_rating": 4,
"restaurant_id": 2,
"item_review": "Yeah it was okay.",
"item_image_url": "https://www.mrbreakfast.com/images/1077_spicy_cheesy_eggs.jpg",
"date_visited": "2020-1-05"
}
The returned object:
{
"id": 4,
"menu_item": "burrito",
"item_price": 6.5,
"item_rating": 4,
"item_review": "Yeah it was okay.",
"restaurant_id": 2,
"reviewed_by": "EthanHoover",
"item_image_url": "https://www.mrbreakfast.com/images/1077_spicy_cheesy_eggs.jpg",
"created_at": "2020-02-04 04:59:46",
"updated_at": "2020-02-04 04:59:46",
"date_visited": "2020-1-05"
}
HTTP Method: [PUT]
URL: /api/reviews/:id
Must be validated user with token
Schema:
| Name | Type | Required | description |
|---|---|---|---|
| menu_item | string | yes/no | name of item from menu |
| item_price | integer | yes/no | price of item |
| item_rating | integer | yes/no | number rating of item |
| restaurant_id | integer | yes/no | the id given to a restaurant |
| item_review | string | yes/no | review of item |
| item_image_url | string | yes/no | picture of item in jpg form |
| date_visited | date | yes/no | date of visitation |
Example
{
"name": "Nice Sweet Potatoes"
}
The returned object will be the same as the updated fields above
{
"name": "Nice Sweet Potatoes"
}
HTTP Method: [GET]
URL: /api/reviews
The returned object will look like:
[
{
"id": 1,
"menu_item": "Mushroom Burger",
"item_price": 8,
"item_rating": 5,
"item_review": "Nice well cooked shroom burger!",
"restaurant_id": 1,
"reviewed_by": "ethan",
"item_image_url": "https://www.simplyrecipes.com/wp-content/uploads/2011/06/grilled-beef-mushroom-burgers-verrtical-a-1800.jpg",
"created_at": "2020-02-03 20:39:38",
"updated_at": "2020-02-03 20:39:38",
"date_visited": "2020-1-20"
},
{
"id": 2,
"menu_item": "Cheesy Bean Burrito",
"item_price": 7,
"item_rating": 3,
"item_review": "Okay burrito, too cheesy.",
"restaurant_id": 3,
"reviewed_by": "kelly",
"item_image_url": "https://images-gmi-pmc.edge-generalmills.com/074a3680-3adc-4aae-85f5-1e3a4f2caa34.jpg",
"created_at": "2020-02-03 20:39:38",
"updated_at": "2020-02-03 20:39:38",
"date_visited": "2020-1-10"
},
]
HTTP Method: [DELETE]
URL: /api/reviews/:id
Must be validated user with token
Schema:
| Name | Type | Required | description |
|---|---|---|---|
| id | integer | yes | review id |
Example
[url]/api/user/:id
returns:
nothing as of right now
HTTP Method: [GET]
URL: /api/users/:username/reviews
The returned object will look like:
[
{
"id": 4,
"menu_item": "burrito",
"item_price": 6.5,
"item_rating": 4,
"item_review": "Yeah it was okay.",
"restaurant_id": 2,
"reviewed_by": "EthanHoover0",
"item_image_url": "https://www.mrbreakfast.com/images/1077_spicy_cheesy_eggs.jpg",
"created_at": "2020-02-04 18:21:54",
"updated_at": "2020-02-04 18:21:54",
"date_visited": "2020-1-05"
},
{
"id": 5,
"menu_item": "Super Amazing Salad",
"item_price": 20.5,
"item_rating": 5,
"item_review": "Yeah it was amazing.",
"restaurant_id": 1,
"reviewed_by": "EthanHoover0",
"item_image_url": "https://www.mrbreakfast.com/images/1077_spicy_cheesy_eggs.jpg",
"created_at": "2020-02-04 18:25:37",
"updated_at": "2020-02-04 18:25:37",
"date_visited": null
}
]
HTTP Method: [POST]
URL: /api/restaurants
Must be validated user with token
Schema:
| Name | Type | Required | description |
|---|---|---|---|
| name | string | yes | name of restaurant |
| cuisine_id | integer | yes | type of cusine |
| location | string | yes | location of restaurant |
| hours_of_operation | string | yes | hours of operation |
| img_url | string | yes | picture of restaurant in jpg form |
| created_by | string | yes* | this is automatically passed through body on the request |
Example
{
"name": "Nicole's Cafe",
"cuisine_id": 1,
"location": "San Diego, CA",
"hours_of_operation": "9:00AM - 9:00PM",
"img_url": "https://koreatownladirectory.com/wpcontent/uploads/2015/02/nicoles-cafe-koreatown-plaza.jpg"
}
The returned object:
{
"id": 23,
"name": "Nicole's Cafe",
"cuisine_id": 1,
"location": "San Diego, CA",
"hours_of_operation": "9:00AM - 9:00PM",
"img_url": "https://koreatownladirectory.com/wpcontent/uploads/2015/02/nicoles-cafe-koreatown-plaza.jpg",
"created_by": "nicole",
"created_at": "2020-02-05 00:46:48",
"updated_at": "2020-02-05 00:46:48"
}
HTTP Method: [PUT]
URL: /api/restaurants/:id
Must be validated user with token
HTTP Method: [GET]
URL: /api/restaurants
The returned object will look like:
[
{
"id": 1,
"name": "Five Guys",
"cuisine_name": "American",
"location": "Las Vegas, NV",
"hours_of_operation": "11:00AM - 9:00PM",
"img_url": "https://www.rd.com/wp-content/uploads/2019/02/five-guys.jpg",
"created_by": "ethan"
},
{
"id": 2,
"name": "Egg Works",
"cuisine_name": "American",
"location": "Las Vegas, NV",
"hours_of_operation": "7:00AM - 1PM",
"img_url": "https://media-cdn.tripadvisor.com/media/photo-s/08/1b/0a/26/egg-works.jpg",
"created_by": "josh"
}
]
HTTP Method: [DELETE]
URL: /api/restaurants/:id
Must be validated user with token
Schema:
| Name | Type | Required | description |
|---|---|---|---|
| id | integer | yes | restaurant id |
Example
[url]/api/restaurants/1
returns:
nothing as of right now
HTTP Method: [GET]
URL: /api/:restaurant_id/reviews
The returned object will look like:
[
{
"id": 1,
"menu_item": "Mushroom Burger",
"item_price": 8,
"item_rating": 5,
"item_review": "Nice well cooked shroom burger!",
"restaurant_id": 1,
"reviewed_by": "ethan",
"item_image_url": "https://www.simplyrecipes.com/wp-content/uploads/2011/06/grilled-beef-mushroom-burgers-verrtical-a-1800.jpg",
"created_at": "2020-02-07 19:41:50",
"updated_at": "2020-02-07 19:41:50",
"date_visited": "2020-1-20"
}
]
HTTP Method: [GET]
URL: /api/users/:username/reviews
The returned object will look like:
[
{
"id": 4,
"menu_item": "burrito",
"item_price": 6.5,
"item_rating": 4,
"item_review": "Yeah it was okay.",
"restaurant_id": 2,
"reviewed_by": "EthanHoover0",
"item_image_url": "https://www.mrbreakfast.com/images/1077_spicy_cheesy_eggs.jpg",
"created_at": "2020-02-04 18:21:54",
"updated_at": "2020-02-04 18:21:54",
"date_visited": "2020-1-05"
},
{
"id": 5,
"menu_item": "Super Amazing Salad",
"item_price": 20.5,
"item_rating": 5,
"item_review": "Yeah it was amazing.",
"restaurant_id": 1,
"reviewed_by": "EthanHoover0",
"item_image_url": "https://www.mrbreakfast.com/images/1077_spicy_cheesy_eggs.jpg",
"created_at": "2020-02-04 18:25:37",
"updated_at": "2020-02-04 18:25:37",
"date_visited": null
}
]
HTTP Method: [GET]
URL: /api/users/:username/restaurants
The returned object will look like:
[
{
"name": "Zaba00s0850080",
"cuisine_name": "Mexican",
"location": "Las Vegas, NV",
"hours_of_operation": "11:00AM - 9PM",
"img_url": "sfdsdf"
},
{
"name": "Zaba00s0850080",
"cuisine_name": "Mexican",
"location": "Las Vegas, NV",
"hours_of_operation": "11:00AM - 9PM",
"img_url": "sfdsdf"
}
]
URL: /api/cuisines
returns all seeded cuisines