Routes - Restaurants

File Name : restaurants.js
File Path : /server/routes/restaurants.js
Restaurants route contains getRestaurants, applyFilter, searchRestaurant, getTotalCat, getCatTypeRestaurant . These functionalities are included in Restaurant Controller.

Get Restaurant Route

  1. API Path: api/restaurants/getRestaurants
  2. Method: GET
  3. Description: This is a protected route which gets the user details through JWT access token which is provided in the header.
  4. Parameters:

    • Name: req
    • Type: Object
    Name Type
    gpsLoc array
    • Name: jwtAccessToken
    • In: Header
    • Type: String
    • Description: JWT access token is used to check the authenticity of the user.
  • Name: res

    • Type: Object
    • Description: res is nothing but the response object which gets you the restaurant details.
  • Response:

    • Http Code: 200
    • Name: returnObj
    • Type: Object
    Name Type
    success boolean
    message string
    restaurant array

Get Restaurant By Applied Filter Route

  1. API Path: api/restaurants/applyFilter
  2. Method: POST
  3. Description: This is a protected route which gets the user details through JWT access token which is provided in the header.
  4. Parameters:

    • Name: req
    • Type: Object
    Name Type
    delivObj object
    rateObj object
    cuisenesType object
    priceRange object
    gpsLoc array
    • Name: jwtAccessToken
    • In: Header
    • Type: String
    • Description: JWT access token is used to check the authenticity of the user.
  • Name: res

    • Type: Object
    • Description: res is nothing but the response object which gets you the restaurant details of applied filter.
  • Response:

    • Http Code: 200
    • Name: returnObj
    • Type: Object
    Name Type
    success boolean
    message string
    data array

Search Restaurant Route

  1. API Path: api/restaurants/searchRestaurant
  2. Method: GET
  3. Description: This is a protected route which gets the user details through JWT access token which is provided in the header.
  4. Parameters:

    • Name: req
    • Type: Object
    Name Type
    txt string
    • Name: jwtAccessToken
    • In: Header
    • Type: String
    • Description: JWT access token is used to check the authenticity of the user.
  • Name: res

    • Type: Object
    • Description: res is nothing but the response object which gets you the restaurant details.
  • Response:

    • Http Code: 200
    • Name: returnObj
    • Type: Object
    Name Type
    success boolean
    message string
    data array

Get Number Of Restaurant Category Route

  1. API Path: api/restaurants/getTotalCat
  2. Method: GET
  3. Description: This is a protected route which gets the user details through JWT access token which is provided in the header.
  4. Parameters:

    • Name: req
    • Type: Object
    Name Type
    gpsLoc array
    • Name: jwtAccessToken
    • In: Header
    • Type: String
    • Description: JWT access token is used to check the authenticity of the user.
  • Name: res

    • Type: Object
    • Description: res is nothing but the response object which gets you the total number of category restaurant.
  • Response:

    • Http Code: 200
    • Name: returnObj
    • Type: Object
    Name Type
    success boolean
    message string
    data array

Get Restaurant By Category Route

  1. API Path: api/restaurants/getCatTypeRestaurant
  2. Method: GET
  3. Description: This is a protected route which gets the user details through JWT access token which is provided in the header.
  4. Parameters:

    • Name: req
    • Type: Object
    Name Type
    gpsLoc array
    catType string
    • Name: jwtAccessToken
    • In: Header
    • Type: String
    • Description: JWT access token is used to check the authenticity of the user.
  • Name: res

    • Type: Object
    • Description: res is nothing but the response object which gets you the restaurant details by category.
  • Response:

    • Http Code: 200
    • Name: returnObj
    • Type: Object
    Name Type
    success boolean
    message string
    data array

Add Restaurant Route By Admin

  1. API Path: api/restaurants/addRestaurant
  2. Method: POST
  3. Description: This is a protected route in which you can add the restaurant.
  4. Parameters:

    • Name: req
    • Type: Object
    Name In Type
    category req.body string
    location req.body string
    name req.body string
    phoneNumber req.body string
    gpsLoc req.body array
    resPhoto req.body string
    • Name: jwtAccessToken
    • In: Header
    • Type: String
    • Description: JWT access token is used to check the authenticity of the user.
  • Name: res

    • Type: Object
    • Description: res is nothing but the response object in which you get the save restaurant details
  • Response:

    • Http Code: 200
    • Name: returnObj
    • Type: Object
    Name Type
    success boolean
    message string
    data object

Get All Restaurant Route For Admin

  1. API Path: api/restaurants/allRestaurant
  2. Method: GET
  3. Description: This is a protected route which gets the user details through JWT access token which is provided in the header.
  4. Parameters:

    • Name: req
    • Type: Object

      Name In Type
      pageNo req.query number
    • Name: jwtAccessToken

    • In: Header
    • Type: String
    • Description: JWT access token is used to check the authenticity of the user.
  • Name: res

    • Type: Object
    • Description: res is nothing but the response object which gets you the all restaurant details.
  • Response:

    • Http Code: 200
    • Name: returnObj
    • Type: Object
    Name Type
    success boolean
    message string
    data array

results matching ""

    No results matching ""