Backent Test created with ExpressJS version ^4.16.1 NodeJS version Used 6.11.3
To use this REST API you need first clone the GIT Repository
git clone https://github.com/jhonnynho/express-backend-test.gitThen go to the backend folder and install the dependencies using this command
cd express-backend-test
npm installOnce the dependencies are installed run the following command on the terminal
cd express-backend-test
npm startIf all its ok, in the terminal will appear this message Server it's ready
To test this REST API you can do it through Postman or another REST client
In all endpoints, you'll need to pass in the headers the ID of Requester User, this is to validate if the Requester User have the permissions to consult the data, e.g:
user_id: a0ece5db-cd14-4f21-812f-966633e7be86All endpoints must be called with the GET method
http://localhost:3001/clientYou'll need to pass the Client ID to retrieve any data, e.g:
http://localhost:3001/client?id=531172fe-352b-41e0-993d-f9f5d34ccb79http://localhost:3001/clientYou'll need to pass the Client Name to retrieve any data, e.g:
http://localhost:3001/client?name=Rochellehttp://localhost:3001/policy/detailsYou'll need to pass the Client Name to retrieve any data, e.g:
http://localhost:3001/policy/details?name=Manninghttp://localhost:3001/policy/userYou'll need to pass the Policy ID to retrieve any data, e.g:
http://localhost:3001/policy/user?policy=64cceef9-3a01-49ae-a23b-3761b604800b