IBM Cloud

Create a starter Node js application with a Cloudant DB service

Hello Friends in this article i am gone to share Create a starter Node js application with a Cloudant DB service with you..

Also visit: Deploy Application Using Command line interface IBM Cloud

Create a starter Node js application with a Cloudant DB Serviceย  IBM Cloud

Objectives

  • Create a starter Node.js application with a Cloudant DB service from a Node.js Cloudant Sample Git repository.
  • Review the service environment variables.

Step 1: Creating a Cloudant DB Instance

  • Log in to your IBM Cloud account.
  • Click on Catalog tab & Search for Cloudant in the box provided and choose Cloudant as shown in the image below.

Cloudant tab

  • A default name for your service instance is generated.ย 
Note:(You can change the service name, if required)
ย 
Select the IAM and legacy credentials option from the available authentication methods and click Create.

ย 

Create Cloudant

 

Step 2: Creating a Node.js application with a Cloudant DB service

  • Go to IBM Cloud Dashboard page.
  • Click the Catalog tab. Search for Cloud Foundry in the box provided and choose Cloud Foundry.

ย 

Cloud Foundry

 

ย 

3) In the Cloud Foundry page, scroll down to Application Runtime and choose SDK for Node.js.

ย 

SDK for Node.js

 

ย 

4) Choose your region and enter a unique name for the application. In the image below, the application name is myFirstNodeCloudantApp.

Accept the defaults for the other fields and click Create.

ย 

Create Node.js Cloud Foundry Application

ย 

NOTE: Wait until the application finishes staging and is running in IBM Cloud before you proceed to the next step. Look for the indication that your app is running.

ย 
Create Node.js Cloud Foundry Application

5) Enable the continuous delivery for your Node.js application from the Overview tab, as shown in the following image.

ย 

Enabling continuous delivery

6) In the Continuos Delivery Toolchain configuration window, change the source repository URL to ย https://github.com/ibm-developer-skills-network/gihrp-nodejs_cloudant.git.

ย 

Toolchain page

 

7) In the same window, go to the Delivery Pipeline Required tab.

ย 
Note:ย You will be asked to create an IBM Cloud API Key for the Delivery Pipeline to automate continuous deliver and click on New

Tool Integrations tile

ย 

8) A new window comes up where you can enter the name of the API key and description and click on Ok

Tool Integrations tile

 

This generates a new IBM Cloud API key

9) Now click on Create for the Tool Chain to be created.

ย 

ย 

Tool Integrations tile

ย 

10) A new page opens, showing a set of tool integrations (THINK, CODE, and DELIVER) that support development, deployment, and operations tasks, as shown in the following image.

ย 

ย 

THINK, CODE, and DELIVER

 

Note: Do not run the deploy stage explicitly under Delivery Pipeline.

11) Go to the previous tab and click Connections on the left navigation bar, then clickย Create Connection.

ย 

Create a connection

12) From the list of available applications, select the cloudant instance you created earlier and click on Next.

ย 

Choose Cloudant

 

ย 
ย 
ย 

13) A window comes up alerting Restaging Required. Click on Connect .

ย 

ย 

Restage after connecting to the Cloudant service

ย 

ย 

14) A message prompts you to restage the application so that it can use the Cloudant service. Click Restage.

ย 

ย 

Restage after connecting to the Cloudant service

ย 

Note: The application restaging will take a couple of minutes. You should see the status next to the application name change fromย 

Restagingย  to Running.

 

ย 
ย 

15) You will now see the cloudant service listed as a connection.

ย 

Connections

ย