Routes - Foods

File Name : food.js
File Path : /server/routes/food.js
Food route contains getFoodMenu, searchFood . These functionalities are included in Food Controller.

Get Food Menu By Restaurant Id Route

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

    • Name: req
    • Type: Object
    Name Type
    id 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 foodMenu and Popolar Food by restaurant Id.
  • Response:

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

Search Food Menu Route

  1. API Path: api/menu/searchFood
  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
    resId 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 food menu details.
  • Response:

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

Add Food Route By Admin

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

    • Name: req
    • Type: Object
    Name In Type
    restaurantId req.body string
    foodName req.body string
    price req.body number
    category req.body array
    foodPhoto 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 food details
  • Response:

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

results matching ""

    No results matching ""