Skip to content
This repository was archived by the owner on Feb 7, 2018. It is now read-only.

Instructions for setting up a local dev environment for Simple Data Pipe

David Taieb edited this page Aug 4, 2015 · 16 revisions

Introduction
As a developer working on Bluemix applications, it is very important that you are able to edit, run and debug your code locally, so that you can be as productive as possible.
This page provides documentation on how to configure the simple data pipe project for local development. It is assumed to the reader is familiar with development of nodejs-based projects and associated tools (npm, node, bower, etc...). Therefore, we'll focus the discussion on the configuration specific to running Simple Data Pipes locally.

Pre-requisites
The first step is to deploy the pipes application on Bluemix. Please follow the tutorial here Simple Data Pipe Tutorial. The next step is to clone and prep the project on your local environment:

git clone https://github.com/ibm-cds-labs/pipes.git
then install all the node and bower dependencies:
npm install

If all goes well, you are now ready to go to the next step which is to configure your local environment to work with Bluemix.

Run the project locally as if it was running on Bluemix
Simple Data Pipes requires to be bound to 3 service instances:

  1. Cloudant NoSQL
  2. DataWorks
  3. DashDB
    The application will bind to the services at runtime and call various apis with the url endpoints registered in the VCAP_SERVICES. The goal is to easily make the VCAP_SERVICES configuration available locally with little to no change to the code so that you can run and debug locally while making api calls to the service instances. There is however another issue with this flow: some service instances like DataWorks use endpoints with private Softlayer IPs which can only be reached when running on Bluemix. To circumvent this problem, the DataWorks nodejs client library can be configured to automatically run a proxy that will automatically read the service definition and proxy the request as appropriate. We'll go into more details in a future blog, but for now I'll show the configuration variable needed to start the proxy on Bluemix and use it in the local environment.

A word about how to set configuration parameters
There are 2 ways to set configuration parameters:

  1. Use environment variables. For example, on linux you can use "export VAR=value" or on Windows "set VAR=value"
  2. Use nconfig json configuration file.

Clone this wiki locally