IBM-Cloud / insurance-orders

Microservice that handles CRUD actions on insurance policy orders

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

2018-06-21: Inactive development, repository archived

The orders and catalog microservices are not used by the Cloud Insurance Co. project. Thus, this repository is no longer maintained and is archived.

Cloud Insurance Co. - Orders

master Build Status
dev Build Status

This service is part of the larger Cloud Insurance Co. project.

Overview

A Node.js app that serves as an API into the orders database for the Cloud Insurance Co.. To store the insurance policy orders, we use a Cloudant NoSQL DB.

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.

Running the app on IBM Cloud

  1. If you do not already have an IBM Cloud account, sign up here.

  2. Download and install the IBM Cloud CLI tool.

  3. The Orders microservice depends on the Catalog microservice. Make sure to deploy the Catalog first.

  4. Clone the app to your local environment from your terminal using the following command:

git clone https://github.com/IBM-Cloud/insurance-orders.git
  1. cd into this newly created directory

  2. Open the manifest.yml file and change the host value to something unique.

The host you choose will determinate the subdomain of your application's URL: <host>.mybluemix.net

  1. 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
  1. Create the Cloudant service in IBM Cloud:
ibmcloud cf create-service cloudantNoSQLDB Lite insurance-policy-db
  1. Push the app to IBM Cloud:
ibmcloud cf push --no-start
  1. Define a variable pointing to the Catalog API deployment.
ibmcloud cf set-env insurance-orders CATALOG_URL https://your-insurance-catalog.mybluemix.net
  1. Start your app:
ibmcloud cf start insurance-orders

And voila! You now have your very own instance of the Insurance Orders API running on IBM Cloud.

Run the app locally

  1. If you do not already have an IBM Cloud account, sign up here

  2. If you have not already, download Node.js and install it on your local machine.

  3. The Orders microservice depends on the Catalog microservice. Make sure to deploy the Catalog first.

  4. Clone the app to your local environment from your terminal using the following command:

git clone https://github.com/IBM-Cloud/insurance-orders.git
  1. cd into this newly created directory

  2. Create a Cloudant service named insurance-policy-db using your IBM Cloud account and replace the corresponding credentials in your vcap-local.json file - using vcap-local.template.json as template file.

  3. In the checkout directory, copy the file .template.env to .env. Edit .env and update the location of the Catalog API.

cp .template.env .env
  1. Install the required npm packages using the following command
npm install
  1. 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:6037.

Contribute

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.

Troubleshooting

The primary source of debugging information for your IBM Cloud app is the logs. To see them, run the following command using the Cloud Foundry CLI:

$ ibmcloud cf logs insurance-orders --recent

For more detailed information on troubleshooting your application, see the Troubleshooting section in the IBM Cloud documentation.

License

See License.txt for license information.

About

Microservice that handles CRUD actions on insurance policy orders

License:Apache License 2.0


Languages

Language:JavaScript 78.8%Language:Shell 8.2%Language:CSS 8.2%Language:HTML 4.9%