RESTful API - Manage clients data This project was an assessment. Assessment details
Clone this repo to test or play with the project.
nodejs v >= 7.6
Steps for running up the code
Install all the dependencies
npm install
Start the server
npm start
The server will run on http://localhost:4000
Run automated tests
npm test
For testing you can use Postman or any other client.
Test login. Send body with email property
POST /users/login
All the below endpoint are private. Be careful of being logged in.
Test Get user data filtered by user id -> Can be accessed by users with role "users" and "admin".
GET /api/users/:id
Test Get user data filtered by user name -> Can be accessed by users with role "users" and "admin". You must send name query param.
GET /api/users/?name=name
Test Get the list of policies linked to a user name -> Can be accessed by users with role "admin"".
GET /api/users/:name/policies
Get the user linked to a policy number -> Can be accessed by users with role "admin".
GET /api/users/policies/:id
For further details you can check the tests files.