The orders and catalog microservices are not used by the Cloud Insurance Co. project. Thus, this repository is no longer maintained and is archived.
master | |
---|---|
dev |
This service is part of the larger Cloud Insurance Co. project.
A Node.js app that serves as an API into the policy database for the Cloud Insurance Co.. To store the insurance policies, we use an IBM Cloudant database.
In order to deploy the full set of microservices involved, check out the insurance-toolchain repo. Otherwise, you can deploy just the app by following the steps here.
-
If you do not already have a IBM Cloud account, sign up here.
-
Download and install the IBM Cloud CLI tool.
-
Clone the app to your local environment from your terminal using the following command:
git clone https://github.com/IBM-Cloud/insurance-catalog.git
-
cd
into this newly created directory. -
Open the
manifest.yml
file and change thehost
value to something unique.
The host you choose will determinate the subdomain of your application's URL: <host>.mybluemix.net
- Connect to IBM Cloud in the command line tool and follow the prompts to log in:
ibmcloud cf login -a https://api.ng.bluemix.net
- Create the Cloudant service in IBM Cloud:
ibmcloud cf create-service cloudantNoSQLDB Lite insurance-policy-db
- Push the app to IBM Cloud:
ibmcloud cf push
Done, that's all! You now have your very own instance of the Insurance Catalog API running on IBM Cloud.
-
If you do not already have a IBM Cloud account, sign up here
-
If you have not already, download Node.js and install it on your local machine.
-
Clone the app to your local environment from your terminal using the following command:
git clone https://github.com/IBM-IBM Cloud/insurance-catalog.git
-
cd
into this newly created directory -
Create a Cloudant service named
insurance-policy-db
using your IBM Cloud account and replace the corresponding credentials in yourvcap-local.json
file - usingvcap-local.template.json
as template file. -
Install the required npm packages using the following command
npm install
- Start your app locally with the following command
npm start
This command will start your Node.js web server and print the address where it is listening to requests in the console: server starting on http://localhost:6034
.
The insurance-catalog app serves as the API to the Cloud Insurance Co. repository of insurance policies. When the app is initialized it checks for the existence of a policies
DB in the Cloudant datastore. If it does not exist, it creates the DB and populates it with the initial policy docs from the routes/starter_docs/policies.json
file. Subsequently, policies in the DB can be manipulated through the API.
name: Policy short name
desc: Longer description of the policy
baseCost: Cost of the policy at the minimum number of days and without additional travelers
perAddTraveler*: Percentage increase to the base policy per additional traveler
cancelRefund: The percentage of the policy cost refunded upon cancellation before the start of the trip
minDays: The minimum number of days for a trip to qualify
perAddDay*: Percentage increase to the base policy per additional day after the minimum number of days
levelCare: Tier of care provided by the policy
amount: Multiplier to determine coverage amount relative to policy cost
review: Average star rating given to the policy by previous customers
* Cost compounded on each addition
Note: When updating the default policies in routes/db.js
, make sure to delete the policies
DB before the app is re-deployed so that the new policies are uploaded.
If you find a bug, please report it via the Issues section or even better, fork the project and submit a pull request with your fix! We are more than happy to accept external contributions to this project if they address something noted in an existing issue. In order to be considered, pull requests must pass the initial Travis CI build and/or add substantial value to the sample application.
The primary source of debugging information for your IBM Cloud app is the logs. To see them, run the following command using the IBM Cloud CLI tool:
$ ibmcloud cf logs insurance-catalog --recent
See License.txt for license information.