In config.env file add
1. MongoDB link
2. DB Password
3. DB Username
In server.js file change path to ./config.env
npm install
npm start
POST request /api/v1/shop
DATA
{
"name": String Required
"phoneNumber": Number Required
"appliance": String Required
"problem": String Required
"address": String Required
"pincode": Number Required
}
response from server :
status code: 201
{
status: 'Ok',
data: {
customerData (That data that you have posted)
}
}
status 400
{
status: 'Fail',
message: err.message,
}
GET request /api/v1/shop/<PHONENUMBER>
user phoneNumber
if phoneNumber is present then User will receive all his Complaints
DATA
{
"name": String
"phoneNumber": Number
"appliance": String
"problem": String
"address": String
"pincode": Number
"resolved": Boolean
"createdAt": DATE
}
DATA
{
"status": "Fail",
"message": "Page not found"
}
POST request at /api/v1/shop/admin/user/login
DATA
{
"username": String Required
"password": String Required
}
Response from server
{
status: 'Ok',
message: 'Login Successful',
}
status: 403
{
status: 'Fail',
message: err.message,
}
GET request at /api/v1/shop/admin/
DATA
{
"name": String
"phoneNumber": Number
"appliance": String
"problem": String
"address": String
"pincode": Number
"resolved": Boolean
"createdAt": DATE
}
POST request at /api/v1/shop/admin/<ID>
ID of that complaint
{
"resolved": true
}
RESPONSE From server
{
status: 'Ok',
data: {
customerData
}
}
{
status: 'Fail',
message: err.message
}