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
- API Path: api/menu/getMenuList
- Method: GET
- Description: This is a protected route which gets the user details through JWT access token which is provided in the header.
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
- API Path: api/menu/searchFood
- Method: GET
- Description: This is a protected route which gets the user details through JWT access token which is provided in the header.
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
- API Path: api/menu/addFood
- Method: POST
- Description: This is a protected route in which you can add the food.
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