Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/manajitpal/restaurantfinder


https://github.com/manajitpal/restaurantfinder

Last synced: 4 days ago
JSON representation

Awesome Lists containing this project

README

        

# Local Development API Server
## Usage
#### Get Restaurants
```
curl "http://localhost:1337/restaurants"
```
#### Get Restaurants by id
````
curl "http://localhost:1337/restaurants/{3}"
````

## Architecture
Local server
- Node.js
- Sails.js

## Contributors

- [Brandy Lee Camacho - Technical Project Manager](mailto:[email protected])
- [David Harris - Web Services Lead](mailto:[email protected])
- [Omar Albeik - Frontend engineer](mailto:[email protected])

## Getting Started

### Development local API Server
_Location of server = /server_
Server depends on [node.js LTS Version: v6.11.2 ](https://nodejs.org/en/download/), [npm](https://www.npmjs.com/get-npm), and [sails.js](http://sailsjs.com/)
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 project dependancies
# npm i
```
###### Install Sails.js globally
```Install sails global
# npm i sails -g
```
###### Start the server
```Start server
# node server
```
### You should now have access to your API server environment
debug: Environment : development
debug: Port : 1337

## 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//?is_favorite=true
```

#### Unfavorite a restaurant
```
http://localhost:1337/restaurants//?is_favorite=false
```

#### 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](https://waffle.io/udacity/mwnd-issues). Even better you can submit a Pull Request with a fix :)