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