Skip to content

pratheepmm/Instant-Home-Service-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Instant-Home-Service-API

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"
}

Installation

Node.js v14+ to run.

Install the dependencies and devDependencies and start the server.

cd Instant-Home-Service-API-master
npm i
npm run dev

To run test.

npm run test

Edit

add customer validation sign up

controllers/customer/customer_validation

add servicer validation sign up

controllers/customer/servicer_validation

add validation login

controllers/utils/validate_login

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors