Note :
- except image field all the fields should be present
- if user doesn't upload any image then image field should not be passed in the request
- store token in the user browser and send the cookie with every request
Error response for all the request
{
"message" : "Cause for the error"
}POST : localhost:3000/customer/signup
request data
{
"email":"david@gmail.com",
"password":"David@123",
"name":"David",
"phone":"3084038433",
"image": "Image file",
"location":"chennai",
"pin_code":"629894",
"country":"india"
}response data
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImRhdmlkMUBnbWFpbC5jb20iLCJpZCI6NSwiaWF0IjoxNjMwMzk2NTA2LCJleHAiOjE2MzA0MDAxMDZ9.l6XO6gAshoEUgX69iPl2G6CSPJFafQVRrAI86wIbOyU"
}POST : localhost:3000/servicer/signup
request data
{
"email" :"rajan@gmail.com",
"password":"rajanPassword123",
"name" : "Rajan",
"phone":"8889993337",
"shop_name" : "Rajan Stores",
"occupation":"Plumber",
"experience" : 2,
"image": "Image file",
"location":"chennai",
"pin_code" : "645333",
"country" : "india"
}response data
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImRhdmlkMUBnbWFpbC5jb20iLCJpZCI6NSwiaWF0IjoxNjMwMzk2NTA2LCJleHAiOjE2MzA0MDAxMDZ9.l6XO6gAshoEUgX69iPl2G6CSPJFafQVRrAI86wIbOyU"
}POST : localhost:3000/customer/signin
{
"email":"david@gmail.com",
"password":"David@123"
}response data
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImRhdmlkMUBnbWFpbC5jb20iLCJpZCI6NSwiaWF0IjoxNjMwMzk2NTA2LCJleHAiOjE2MzA0MDAxMDZ9.l6XO6gAshoEUgX69iPl2G6CSPJFafQVRrAI86wIbOyU"
}POST : localhost:3000/servicer/signin
{
"email" :"rajan@gmail.com",
"password":"rajanPassword123"
}response data
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImRhdmlkMUBnbWFpbC5jb20iLCJpZCI6NSwiaWF0IjoxNjMwMzk2NTA2LCJleHAiOjE2MzA0MDAxMDZ9.l6XO6gAshoEUgX69iPl2G6CSPJFafQVRrAI86wIbOyU"
}Node.js v14+ to run.
Install the dependencies and devDependencies and start the server.
cd Instant-Home-Service-API-master
npm i
npm run devTo run test.
npm run testadd customer validation sign up
controllers/customer/customer_validationadd servicer validation sign up
controllers/customer/servicer_validationadd validation login
controllers/utils/validate_login