This CRM is a NodeJS mockup of a potential on-premise CRM for demo purposes. The CRM is updated when the MessageHub consumer calls the rest api's to create the new customers and visits. It then syncs with DashDB by immediately writing the new customers and visits to DashDB.
- How to setup DashDB config in the Mock CRM
- How to run the Mock CRM on your Machine
- How to test CRM
1 - Open the dasdhdb-credentials.json file
cd MotoCorpService/CRM2 - Set DashDB credentials as found in your Bluemix instance

1 - Install any dependencies
npm install2 - Run the CRM locally
node app.jsTo use SecureGateway later in the lab, it is recommended to run the CRM behind a firewall.
In the command line, you can test the CRM.
1 - To create a customer
curl -X POST -H "Content-Type: application/json" -d '{ "Name": "John Doe", "LicensePlate": "ABC-123","Make":"Honda", "Model":"CRV", "VIN":"12345667" }' "http://localhost:8000/customers/" -vvGo into your DashDB Customer table to confirm a customer record was created.
2 - To create a visit
curl -X POST -H "Content-Type: application/json" -d '{ "date": "2016-06-23", "type": "oil visit", "comment": "hello this is a comment"}' "http://localhost:8000/customers/1/visits" -vvGo into your DashDB Visit table to confirm a visit record was created.
3 - To list all customers
curl -X GET http://localhost:8000/customers -vv4 - To list all visits
curl -X GET http://localhost:8000/customers/1/visits/ -vv
