Closed azharanees closed 5 years ago
IN DEVELOPMENT
Initial Development of the API with endpoints using in memory database of mongodb.
General components of the application that this PR will affect:
GET USERS
URL
http://localhost:3000/
Method:
GET
URL Params
No Params
Required:
No Required fields
Optional:
No Optional fields
Data Params
No Data Params
Success Response:
[ { "_id": "xxxxxxxxxxxxxxx", "title": "Hello, now from the in-memory database!" } ]
Sample Call:
curl http://localhost:3000/
ADD USER
POST
{ "name": "testUser", "email": "test@test.com" }
[ { "message": "New user added." } ]
curl -X POST -H 'Content-Type: application/json' -d '{ "title": "Pizza", "price": 10.5 }' http://localhost:3000/
UPDATE USER
PUT
id=[integer]
{ "name": String, "email": String, "country" : String, }
String
[ { "message": "User updated." } ]
curl -X PUT -H 'Content-Type: application/json' -d '{ "price": 12.5 }' http://localhost:3000/5858754545
DELETE USER
DELETE
Data Params No data params
[ { "message": "User deleted." } ]
curl -X DELETE http://localhost:3000/5654654
API
Status
IN DEVELOPMENT
Description
Initial Development of the API with endpoints using in memory database of mongodb.
Todo
Impacted Areas in Application
General components of the application that this PR will affect:
Risk Assessment Framework API
GET USERS
URL
http://localhost:3000/
Method:
GET
URL Params
No Params
Required:
No Required fields
Optional:
No Optional fields
Data Params
No Data Params
Success Response:
Content:
[ { "_id": "xxxxxxxxxxxxxxx", "title": "Hello, now from the in-memory database!" } ]
Sample Call:
curl http://localhost:3000/
ADD USER
URL
http://localhost:3000/
Method:
POST
URL Params
No Params
Required:
No Required fields
Optional:
No Optional fields
Data Params
{ "name": "testUser", "email": "test@test.com" }
Success Response:
Content:
[ { "message": "New user added." } ]
Sample Call:
curl -X POST -H 'Content-Type: application/json' -d '{ "title": "Pizza", "price": 10.5 }' http://localhost:3000/
UPDATE USER
URL
http://localhost:3000/
Method:
PUT
URL Params
id=[integer]
Required:
id=[integer]
Optional:
No Optional fields
Data Params
{ "name":
String
, "email":String
, "country" :String
, }Success Response:
Content:
[ { "message": "User updated." } ]
Sample Call:
curl -X PUT -H 'Content-Type: application/json' -d '{ "price": 12.5 }' http://localhost:3000/5858754545
DELETE USER
URL
http://localhost:3000/
Method:
DELETE
URL Params
id=[integer]
Required:
id=[integer]
Optional:
No Optional fields
Data Params No data params
Success Response:
Content:
[ { "message": "User deleted." } ]
Sample Call:
curl -X DELETE http://localhost:3000/5654654