Skip to content

SnehalAgrawal/about-react-dummy-apis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

To Run the Project

  • Clone Repo

    git clone https://github.com/SnehalAgrawal/about-react-dummy-apis.git
  • Jump into the directory

    cd about-react-dummy-apis
  • Install:

     npm install
  • Run the app:

     npm start

APIs and Payload

  1. Register
    URL: http://localhost:3000/api/user/register
    Method: POST
    Payload:
    {
      "name":"AboutReact",
      "age":40,
      "email":"[email protected]",
      "address":"P.O. Box 168, 1015 Orci Street",
      "password":"12345"
    }
    Success Response:
    {
      "status": "success",
      "data": {
        "name": "AboutReact",
        "age": 40,
        "email": "[email protected]",
        "address": "P.O. Box 168, 1015 Orci Street",
        "password": "12345"
      },
      "msg": ""
    }
    Failure Response:
    {
      "status": "failed",
      "data": {},
      "msg": "User Already Exists"
    }
  2. Login
    URL: http://localhost:3000/api/user/login
    Method: POST
    Payload:
    {
      "email": "[email protected]",
      "password": "12345"
    }
    Success Response:
    {
      "status": "success",
      "data": {
        "name": "AboutReact",
        "age": 40,
        "email": "[email protected]",
        "address": "P.O. Box 168, 1015 Orci Street",
        "password": "12345"
      },
      "msg": ""
    }
    Failure Response:
    {
      "status": "failed",
      "data": {},
      "msg": "No UserId / Password Found"
    }
  3. Search
    URL: http://localhost:3000/api/user/search?q=aboutreact
    Method: GET
    User Found Response:
    {
      "status": "success",
      "data": [
        {
          "name": "AboutReact",
          "age": 40,
          "email": "[email protected]",
          "address": "P.O. Box 168, 1015 Orci Street",
          "password": "12345"
        }
        ....
        ....
        ....
      ],
      "msg": ""
    }
    User Not Found Response:
    {
      "status": "success",
      "data": [],
      "msg": ""
    }

By

AboutReact