Creating a Cloud Foundry application in the IBM Cloud Platform

  1. To create an application in IBM Cloud, access https://console.bluemix.net, select the Create Resource option, and select Cloud Foundry Apps in the left menu, followed by SDK for Node.js. After doing this, name the application and create the runtime:
  1. When application creation is complete, select Connections in the left menu and create a connection to the IoT service:
  1. After creating the connection to the IBM Watson IoT Platform organization, select the Runtime option in the left menu followed by Environment Variables. At the bottom of the screen, add two User defined variables, MINIMUM_MOISTURE with a value of 300 and MAXIMUM_TEMPERATURE with a value of 50:

Instead of using a JSON file for storing the configuration as we did in the previous chapter, the only configuration needed now is in VCAP_SERVICES and environment variables. These variables can be accessed from code using default library packages, and there are accelerators in Node.js for accessing Cloud Foundry environment-related facilities, such as the cfenv module used in the code presented in the following section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.4.239