/yelpTestApi

A test project, please find README.md

Primary LanguageJavaScript

A sample project for using yelp API

Setup steps

  1. Create an .env file and declare environment variable NODE_ENV="develop" this will make the nodejs application to use all the environment variable from config.develop.js on the config directory
  2. Commands to follow
  • for Local Environment
    $ npm i 
    $ node app.js
    
    
  • for docker environment
    $ docker-compose up -d
    

APIs

GET {host}:{port}/topCategoryInCity?category=string&location=string&limit=int
Parameter Type Description
category string category as per https://www.yelp.com/developers/documentation/v3/all_category_list
location string location name default set as 'redwoodcity'
limit string limit for number of records ( default set to 1 )

Responses

{
{
  "success": true,
  "message": [
    {
      "name": "Romolo's Cannoli",
      "business_address": "81 37th Ave, San Mateo, CA 94403",
      "reviews": [
        {
          "review": "I was in the Bay Area on business and arranged to get together with my sister and her partner in San Francisco for dinner over the weekend. My sister is the...",
          "personName": "Richard H."
        },
        {
          "review": "Old fashion ice cream, cannoli and cookies. The  cannoli is a must!!! Made to order. The chill, creamy and delightful cream with crunchy shells. \n\nCan I...",
          "personName": "Will K."
        },
        {
          "review": "I was pretty unimpressed with the cannoli and ice cream, especially given the stellar reviews. Maybe they had an off day...\n\nI got the regular...",
          "personName": "Victoria S."
        }
      ]
    }
  ]
}
}