Routes - Address
File Name : address.js
File Path : /server/routes/address.js
Address route contains saveAddress, getSaveAddress, updateAddress and deleteAddress . These functionalities are included in Address Controller.
Save Address Route
- API Path: api/address/saveAddress
- 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 newAddress string active string houseNo string landMark string addressGpsLoc 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 in which you can save the address details of the user.
Response:
- Http Code: 200
- Name: returnObj
- Type: Object
Name Type success boolean message string data object
Get Save Address Route
- API Path: api/address/getAddress
- 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: 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 save address details to the user.
Response:
- Http Code: 200
- Name: returnObj
- Type: Object
Name Type success boolean message string data array
Update Address Route
- API Path: api/address/updateAddress
- Method: PUT
- 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 newAddress string active string houseNo string landMark string addressGpsLoc array 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 updated address details to the user.
Response:
- Http Code: 200
- Name: returnObj
- Type: Object
Name Type success boolean message string data object
Delete Address Route
- API Path: api/address/deleteAddress
- 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 addressId 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 save address details except the deleted address to the user.
Response:
- Http Code: 200
- Name: returnObj
- Type: Object
Name Type success boolean message string data object