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
- API Path: api/restaurants/getRestaurants
- 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 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
- API Path: api/restaurants/applyFilter
- Method: POST
- 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 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
- API Path: api/restaurants/searchRestaurant
- 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 - 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
- API Path: api/restaurants/getTotalCat
- 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 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
- API Path: api/restaurants/getCatTypeRestaurant
- 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 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
- API Path: api/restaurants/addRestaurant
- Method: POST
- Description: This is a protected route in which you can add the restaurant.
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
- API Path: api/restaurants/allRestaurant
- 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 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