/Business-finder

Epicodus Independent Project - Building an API

Primary LanguageRuby

README

Local Restaurant Locator

Epicodus Ruby Independent Project Week 6, August 23th, 2019

By Garland Lai

Description

This API contains local restaurants and reviews.

Setup/Installation Requirements

  1. Click here to get started!
  2. Clone repository.
  3. Enter project root directory and type "bundle install" to install all necessary gems.
  4. Type "rake db:create" to create the databases.
  5. Type "rake db:seed" to seed the products and reviews
  6. Sign into Postman to test API calls"

Endpoint to Test:

*Please note the ":restaurant_id" and ":id" are placeholders for ID number

Behavior Route Input Output
GET all restaurants localhost:3000/v1/restaurants Returns all restaurants
POST a restaurant localhost:3000/v1/restaurants Create a new restaurant
UPDATE a restaurant localhost:3000/v1/restaurants/:id Updates restaurant
DELETE a restaurant localhost:3000/v1/restaurants/:id Deletes restaurant off the list
GET reviews for a restaurant localhost:3000/v1/restaurants/:restaurant_id/reviews Returns all reviews for the restaurant
GET specific review for a restaurant localhost:3000/v1/restaurants/:restaurant_id/reviews/:id Returns a review for a restaurant
POST review for a restaurant localhost:3000/v1/restaurants/:restaurant_id/reviews/ Creates a review for a restaurant
UPDATE a review for a restaurant localhost:3000/v1/restaurants/:restaurant_id/reviews/:id Updates current restaurant
DELETE a review for a restaurant localhost:3000/v1/restaurants/:restaurant_id/reviews/:id Deletes restaurant review
GET a random restaurant localhost:3000/v1/restaurants/random Returns a randomized restaurant from database
GET a restaurant by origin parameter search localhost:3000/v1/restaurants/origin?=Greek Returns all restaurants with the origin "Greek"

Known Bugs

  • No known bugs

Support and contact details

If you have any questions, concerns, or suggestions, please contact me at Garlandlai24@gmail.com

Technologies Used

  • Github
  • Ruby on Rails
  • PostMan
  • Gems: Shoulda-matchers, Faker, rspec-rails, Factory_bot, and others

License

This webpage is licensed under the MIT license.

Copyright (c) 2019 Garland Lai