Hi! This is an API where it's possible to list users and policies from data in data folder.
It has authentication and authorization - admin role is needed to filter users by policy and list policies.
The API is deployed on Heroku here.
POST /loginGET /users?id={id}&name={name}&policy={policy}GET /policies?username={username}
- To login, make a
POSTtohttps://insurance-api-test.herokuapp.com/loginwith the following body:{ "email": "britneyblankenship@quotezart.com" } - Get the
tokenand use it in the subsequent requests: headerAuthorization: Bearer {token} - To get a user by id, make a
GETtohttps://insurance-api-test.herokuapp.com/users?id=a0ece5db-cd14-4f21-812f-966633e7be86 - To get a user by name, make a
GETtohttps://insurance-api-test.herokuapp.com/users?name=Britney - To get the list of policies linked to a user name, make a
GETtohttps://insurance-api-test.herokuapp.com/policies?username=Britney. Only allowed foradminusers. - To get the user linked to a policy number, make a
GETtohttps://insurance-api-test.herokuapp.com/users?policy=64cceef9-3a01-49ae-a23b-3761b604800b. Only allowed foradminusers.
- This project uses Node 11.7 with native ES Modules
- Routes are defined in Express and authentication is handled by
jsonwebtoken - Folders are organized around features instead of roles
- App automatically deployed to Heroku on each push to master
npm installandnpm startwill run the application with nodemon for live reloadsnpm testruns tests