Development server for students completing stage three of the restaurant reviews project for Mobile Web Specialist Nanodegree
https://restaurant-reviews-client.herokuapp.com
Also check cloud-server
and cloud-api
branches for source code.
curl "http://localhost:1337/restaurants"
curl "http://localhost:1337/restaurants/{3}"
Local server
Location of server = /server
Server depends on node.js LTS Version: v6.11.2 , npm, and sails.js
Please make sure you have these installed before proceeding forward.
Great, you are ready to proceed forward; awesome!
Let’s start with running commands in your terminal, known as command line interface (CLI)
```Install project dependancies
###### Install Sails.js globally
```Install sails global
# npm i sails@0.12.14 -g
```Start node api server
###### Start python web server (requires python3)
```Start python web server (requires python3)
# python server.py
**API**
debug: Environment : development
debug: Port : 1337
**WEB**
Port : 8000
## Endpoints
### GET Endpoints
#### Get all restaurants
http://localhost:1337/restaurants/
#### Get favorite restaurants
http://localhost:1337/restaurants/?is_favorite=true
#### Get a restaurant by id
http://localhost:1337/restaurants/
#### Get all reviews for a restaurant
http://localhost:1337/reviews/?restaurant_id=
#### Get all restaurant reviews
http://localhost:1337/reviews/
#### Get a restaurant review by id
http://localhost:1337/reviews/
#### Get all reviews for a restaurant
http://localhost:1337/reviews/?restaurant_id=
### POST Endpoints
#### Create a new restaurant review
http://localhost:1337/reviews/
###### Parameters
{
“restaurant_id”:
“name”:
“rating”:
“comments”:
}
### PUT Endpoints
#### Favorite a restaurant
http://localhost:1337/restaurants/
#### Unfavorite a restaurant
http://localhost:1337/restaurants/
#### Update a restaurant review
http://localhost:1337/reviews/
###### Parameters
{
“name”:
“rating”:
“comments”:
}
### DELETE Endpoints
#### Delete a restaurant review
http://localhost:1337/reviews/
```
If you find a bug in the source code or a mistake in the documentation, you can help us by
submitting an issue to our Waffle Dashboard. Even better you can submit a Pull Request with a fix :)