Skip to content

astb01/claimants-service-js

Repository files navigation

Claimants Service

This simple Express JS RESTful service performs CRUD operations for a claimant as well as validating a claimant's driving licence (if the person has one).

The project uses MongoDB with the use of Mongoose and makes use of Sinon, Nock and Chai-Http.

Endpoints

The following endpoints are exposed:

Method Path Purpose
GET /api/claimants Retrieves all claimants
GET /api/claimants/:id Retrieves a claimant by their ID
GET /api/claimants/ref/:refNo Retrieves a claimant by unique reference
POST /api/claimants Creates a claimant
PUT /api/claimants/:id Updates a claimant using their ID
DEL /api/claimants/:id Deletes a claimant using their ID

Pre-Requisites

For this project to run you need to install Node. To do so please visit the Node website: https://nodejs.org/en/download/

This project also makes use of MongoDB. You can either:

Getting Started

Once you have checked out the project to a directory of your liking, simply run the following command to download the relevant dependencies:

npm install

Dependencies

In summary here is a list of the dependencies used within this project (for further details please refer to the package.json file.):

For Testing:

For code coverage the nyc module has been integrated.

Running Tests

To run the unit tests simply use the following command:

npm run unit

To run the integration tests simply use the following command:

npm run integration

To run both unit and integration tests:

npm test

Linting

Airbnb's Config has been used and to run lint you can use the following command:

npm run lint

NB: Linting has been configured to run as part of the npm test command.

About

Claimants RESTful Service written in Express JS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published