<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Cloud Foundry Foundation</title>
    <description>The latest articles on DEV Community by Cloud Foundry Foundation (@cloudfoundry).</description>
    <link>https://dev.to/cloudfoundry</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F3074%2F372e02e5-e749-49ca-a5c1-ebf4b08db857.png</url>
      <title>DEV Community: Cloud Foundry Foundation</title>
      <link>https://dev.to/cloudfoundry</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cloudfoundry"/>
    <language>en</language>
    <item>
      <title>Deploy a Nodejs App on Cloud Foundry Pt.3 - Hello World to Real World</title>
      <dc:creator>akintayo shedrack</dc:creator>
      <pubDate>Tue, 27 Oct 2020 13:30:19 +0000</pubDate>
      <link>https://dev.to/cloudfoundry/deploy-a-nodejs-app-on-cloud-foundry-pt-3-hello-world-to-real-world-4peh</link>
      <guid>https://dev.to/cloudfoundry/deploy-a-nodejs-app-on-cloud-foundry-pt-3-hello-world-to-real-world-4peh</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In the &lt;a href="https://medium.com/cloud-foundry-foundation/deploy-a-nodejs-app-on-cloud-foundry-pt-2-services-33e76ed62be9" rel="noopener noreferrer"&gt;second part&lt;/a&gt; of this tutorial, I demonstrated how to deploy a Node.js application on Cloud Foundry, make a few changes to the deployed application to see how fast Cloud Foundry updates our application in the browser and finally, bind our application to a database service. I also gave an introduction to what services are in Cloud Foundry and how to get started with them.&lt;/p&gt;

&lt;p&gt;In this tutorial, we will be deploying a full stack application on Cloud Foundry with a Node.js backend and a MongoDB database service. I'll demonstrate how to use a database service we will create in our application to read, write data to our application and also persist data. &lt;/p&gt;

&lt;p&gt;We will also make a few changes to our deployed application and re-deploy our application to see how fast Cloud Foundry updates our application in the browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Cloud Foundry CLI.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Any Cloud Foundry distribution account. (I'll be using &lt;a href="https://paas.anynines.com/" rel="noopener noreferrer"&gt;anynines&lt;/a&gt; for the sake of this tutorial).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A &lt;a href="https://cloudinary.com/" rel="noopener noreferrer"&gt;Cloudinary&lt;/a&gt; account for storing images that'll be uploaded (API key and API Secret).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Basic Knowledge MongoDB, Node.js and &lt;a href="https://katacoda.com/cloudfoundry-tutorials/scenarios/trycf" rel="noopener noreferrer"&gt;Cloud Foundry&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Tech Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The client-side of the application is written with EJS.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The server-side of the application is written in Node.js.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cloudinary handles the storing of images that are uploaded.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;MongoDB handles the storing of the image urls that are used to display the images on the client-side.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Setting Up Our Application
&lt;/h2&gt;

&lt;p&gt;To get started, we have to clone our application from Github and install its dependencies on our machine. Run the following command to clone the application to your machine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/hacktivist123/cloudfoundry-nodejs-tutorial-pt-3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After cloning the application from Github, you can install the application on your local machine by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After installing the project, you'll need to create a &lt;code&gt;.env&lt;/code&gt; file. There's a &lt;code&gt;.env.sample&lt;/code&gt; file with the structure of how your &lt;code&gt;.env&lt;/code&gt; file should look and what it should contain in the project root folder. For example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NODE_ENV = production
MONGO_URI = &amp;lt;your mongodb service connection uri&amp;gt;
CLOUDINARY_CLOUD_NAME = &amp;lt;your cloudinary cloud name&amp;gt;
CLOUDINARY_API_KEY = &amp;lt;your cloudinary API key&amp;gt;
CLOUDINARY_API_SECRET = &amp;lt;your cloudinary API Secret&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;NODE_ENV&lt;/code&gt; = The current deployment environment, i.e development or production.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;MONGO_URI&lt;/code&gt; = MongoDB service connection URI (this will be provided when we create a Cloud Foundry database service).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;CLOUDINARY_CLOUD_NAME&lt;/code&gt; = This will be available on your Cloudinary dashboard after registration.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;CLOUDINARY_API_KEY&lt;/code&gt; = This will be available on your Cloudinary dashboard after registration.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;CLOUDINARY_API_SECRET&lt;/code&gt; = This will be available on your Cloudinary dashboard after registration.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you run the application by running yarn start on your local machine and with a local MongoDB server, you'll get the following in your browser when you navigate to &lt;code&gt;localhost:8080&lt;/code&gt;or the PORT number you provided in the &lt;code&gt;.env&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1600%2F0%2A8-Xr2pRncAHtag_q" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1600%2F0%2A8-Xr2pRncAHtag_q"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While this works locally, we cannot use the local MongoDB server when we deploy our application on Cloud Foundry. We need a database service to help us manage the database when it's deployed live.&lt;/p&gt;

&lt;p&gt;Let's test this theory by deploying our application on Cloud Foundry.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deploying our Application
&lt;/h2&gt;

&lt;p&gt;You can deploy to the application by running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cf push &amp;lt;app name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you've not noticed already, when we push the application initially, it throws an error that looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1600%2F0%2AshfF4yRbxjz3Mw4r" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1600%2F0%2AshfF4yRbxjz3Mw4r"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We are getting this error because Cloud Foundry cannot recognize or see any connection URI for our MongoDB database. &lt;/p&gt;

&lt;p&gt;We need to create a MongoDB database service to fix this error and use the connection URI it provides for us.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating our MongoDB Database Service
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Why do we need a database service?
&lt;/h3&gt;

&lt;p&gt;Well, we need a database service because we cannot use a local database server when we deploy our application live and also to persist data. When you cf push, an entirely new version of your application is deployed and all old data will be deleted. &lt;/p&gt;

&lt;p&gt;What a database service will do for us is to persist data we've uploaded into our application so that even if we push our application on Cloud Foundry over and over again, we'll still have access to the existing data we've uploaded into our application database.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating the Service
&lt;/h3&gt;

&lt;p&gt;It's very easy to create a database service with Cloud Foundry; we can do that by running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cf create-service SERVICE PLAN SERVICE_INSTANCE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The service and plan depend on the distribution of Cloud Foundry you're using. Cloud Foundry distributions provide different types of services. For the sake of this tutorial, I'll be using the anynines MongoDB service by running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cf create-service a9s-mongodb34 mongodb-nano cf-database
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;a9s-mongodb34&lt;/code&gt; = The service name&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;mongodb-nano&lt;/code&gt; = The service plan&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;cf-database&lt;/code&gt; = The service instance name&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When I run the above command, the following will be displayed:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1600%2F0%2Aicaz6wGnz_EsNsQG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1600%2F0%2Aicaz6wGnz_EsNsQG"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To know if the service has been created successfully, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cf service cf-database
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above command will display the following details about the service:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1600%2F0%2AHBzOd4mNc3elj7N8" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1600%2F0%2AHBzOd4mNc3elj7N8"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On a side note, you can only make use of the service when the status of the service is "&lt;strong&gt;create succeeded.&lt;/strong&gt;"&lt;/p&gt;

&lt;p&gt;Now that our service has been created successfully, we have to bind the service to our application so that our application can use the service. We can do that by running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cf bind-service APP_NAME SERVICE_INSTANCE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When we run the above command according to our app name and service name, we will see the following in our terminal:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1600%2F0%2A3-VwUwmcsJVIqcjX" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1600%2F0%2A3-VwUwmcsJVIqcjX"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have successfully bound the database service we created to our application. &lt;/p&gt;

&lt;p&gt;The next step is to use the URI provided by the MongoDB service as our &lt;code&gt;MONGO_URI&lt;/code&gt; in our &lt;code&gt;.env&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;We can find the URI by running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cf &lt;span class="nb"&gt;env&lt;/span&gt; &amp;lt;APP_NAME&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After running the above command, you should see the following displayed in your terminal:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1600%2F0%2AvzM6nbzHPHjy_gr0" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1600%2F0%2AvzM6nbzHPHjy_gr0"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you look closely at the JSON file generated by the command, you'll see the database URI, username and also password.&lt;/p&gt;

&lt;p&gt;Now we need to grab the database URI and use it on our application. We can do that by copying the URI from our terminal and pasting it into our &lt;code&gt;.env&lt;/code&gt; file. &lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MONGO_URI = mongodb://a9s-brk-usr-5fce266678f7b5d5061399d079c7cb58e3541b95:a9sfa381ca6ba0d48f166c0299b1ce4d119ff6321e1@mod22bb57-mongodb-0.node.dc1.a9ssvc:27017/mod22bb57
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Why is this working?
&lt;/h3&gt;

&lt;p&gt;In our &lt;code&gt;index.js&lt;/code&gt; file, we are grabbing the &lt;code&gt;MONGO_URI&lt;/code&gt;variable from the &lt;code&gt;.env&lt;/code&gt; file and using it to start the database connection like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nx"&gt;mongoose&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;MONGO_URI&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="na"&gt;useNewUrlParser&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
 &lt;span class="na"&gt;useUnifiedTopology&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
 &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;isDevelopment&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Pushing our app live with the database service
&lt;/h2&gt;

&lt;p&gt;Now let's try to push our application again and see whether it throws an error. We can do that by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cf push &amp;lt;APP_NAME&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we run the above command and wait for a while for it to finish deploying, we'll see the following message in our terminal:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1600%2F0%2ABEhW_r0lJSZu4HhC" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1600%2F0%2ABEhW_r0lJSZu4HhC"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If we navigate to the route that was created after the deploy, we'll see our application deployed live without any errors.&lt;/p&gt;

&lt;h2&gt;
  
  
  Making a change in our application
&lt;/h2&gt;

&lt;p&gt;Now let's make a change to our application, re-deploy and see if the images in the database will still remain the same. For the change, let's make the color of the header text "&lt;strong&gt;mini-instagram&lt;/strong&gt;" to blue.&lt;/p&gt;

&lt;p&gt;Navigate to the css directory inside the project folder and locate the style.css file. Paste the following code in the file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;blue&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After adding the above piece of code, we will push our application again so that we can see the changes.&lt;/p&gt;

&lt;p&gt;We can do that by running &lt;code&gt;cf push &amp;lt;APP_ NAME&amp;gt;&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;After pushing, wait for it to deploy and navigate/refresh to the generated route link to see the changes happen.&lt;/p&gt;

&lt;p&gt;If you did the above instructions correctly, you should see the header text color change from black to blue like so:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1600%2F0%2AtQeLubgK_2wd7gQN" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1600%2F0%2AtQeLubgK_2wd7gQN"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We made a change and redeployed our application and we can still see our images (data) available.&lt;/p&gt;

&lt;p&gt;Now if you try to upload a random image and also refresh the page, we'd still have the image available to us along with the rest of the existing images.&lt;/p&gt;

&lt;p&gt;Here's a link to the visual representation of the process:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://drive.google.com/file/d/1XT7ux9Fktt8HbdW_D7DAdiQX5tqI-cDz/view?usp=sharing" rel="noopener noreferrer"&gt;https://drive.google.com/file/d/1XT7ux9Fktt8HbdW_D7DAdiQX5tqI-cDz/view?usp=sharing&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the above media, I uploaded a new photo and then refreshed the application over and over again to check if we lost any data but we didn't. This is the power of the database service we used.&lt;/p&gt;

&lt;p&gt;You can find the supporting Repo for this tutorial, &lt;a href="https://github.com/hacktivist123/cloudfoundry-nodejs-tutorial-pt-3" rel="noopener noreferrer"&gt;here&lt;/a&gt; and you can also find the video tutorial &lt;a href="https://youtu.be/qvso2fRKRy8" rel="noopener noreferrer"&gt;here&lt;/a&gt; if you prefer watching videos instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this tutorial we took an application, deployed it on Cloud Foundry, created a MongoDB database service for the application and then re-deployed it on Cloud Foundry. &lt;/p&gt;

&lt;p&gt;We also made a few changes to the application and redeployed it to see if we would lose any data but we didn't, thanks to the power of the database service we used.&lt;/p&gt;

&lt;p&gt;Services in Cloud Foundry are really powerful. We can do a whole lot of things with various services that are available to Cloud Foundry users.&lt;/p&gt;

&lt;p&gt;Did you enjoy this tutorial? Let me know by dropping comments about your favourite aspect of the tutorial in the comments section. Also, if you have any questions, you can drop one in the comment section and I'll definitely give a reply.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;The best way to connect with the Cloud Foundry community is to join our Slack Workspace at &lt;a href="https://slack.cloudfoundry.org/" rel="noopener noreferrer"&gt;https://slack.cloudfoundry.org/&lt;/a&gt;. Those in the Slack community help you get quickly connected with other members or someone from the Cloud Foundry Foundation&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>node</category>
      <category>kubernetes</category>
      <category>cloudfoundry</category>
    </item>
    <item>
      <title>Intrographic: Paketo Buildpack Benefits For Operators and Developers</title>
      <dc:creator>Ram Iyengar</dc:creator>
      <pubDate>Fri, 25 Sep 2020 13:05:58 +0000</pubDate>
      <link>https://dev.to/cloudfoundry/infographic-paketo-buildpack-benefits-for-operators-and-developers-3p3f</link>
      <guid>https://dev.to/cloudfoundry/infographic-paketo-buildpack-benefits-for-operators-and-developers-3p3f</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mDKqzu5t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/o5v0fjawqku7sdtwon4b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mDKqzu5t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/o5v0fjawqku7sdtwon4b.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Paketo Buildpacks leverage the Cloud Native Buildpacks spec to make container image builds simple, fast, and secure. Learn more at paketo.io.&lt;/p&gt;

</description>
      <category>cloudfoundry</category>
      <category>paketo</category>
      <category>buildpacks</category>
      <category>containers</category>
    </item>
    <item>
      <title>Cloud Foundry Essentials</title>
      <dc:creator>akintayo shedrack</dc:creator>
      <pubDate>Thu, 10 Sep 2020 19:09:44 +0000</pubDate>
      <link>https://dev.to/cloudfoundry/cloud-foundry-essentials-27hn</link>
      <guid>https://dev.to/cloudfoundry/cloud-foundry-essentials-27hn</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In this blog post, I'm going to be talking about all things Cloud Foundry, including some of its services, certified and other commercial providers. I'll also be demonstrating how to get started with Cloud Foundry quickly.&lt;/p&gt;

&lt;p&gt;The main aim of this blog post is to serve as documentation for people that want to see what the Cloud Foundry community offers and how to locate or get started with their preferred method of deploying their applications to Cloud Foundry.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Cloud Foundry?
&lt;/h2&gt;

&lt;p&gt;According to the official Cloud Foundry website, Cloud Foundry is an open-source platform that allows application development teams to build, test, deploy, and scale applications.&lt;br&gt;
It also provides an underlying infrastructure including Kubernetes, developer frameworks, and application services.&lt;br&gt;
Cloud Foundry is known for its awesome developer experience. The project is backed by Google, IBM, Microsoft, SAP, SUSE, VMware, and more.&lt;/p&gt;

&lt;p&gt;Cloud Foundry takes the workload off developers and lets them ​​focus on only the application code and business outcomes by making all those tasking deployment processes disappear.&lt;/p&gt;

&lt;p&gt;In summary, Cloud Foundry takes ​away the burden of managing complexity and running containerized workloads of an application from developers and allows them to worry or stay focused on application code and the business outcomes. Aside from just taking away the burden, it also provides benefits. For example, packing and containerization come free.&lt;/p&gt;
&lt;h2&gt;
  
  
  Cloud Foundry Providers
&lt;/h2&gt;

&lt;p&gt;The officially certified providers of the Cloud Foundry platform are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Atos Cloud Foundry&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;IBM Cloud Foundry (formerly Bluemix)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SAP Cloud Platform&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SUSE Cloud Application Platform&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Swisscom Application Cloud&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;VMware Tanzu&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Other distributions of Cloud Foundry include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;anynines Public PaaS&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Pivotal Web Services&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Cloud Foundry Command Line Interface
&lt;/h2&gt;

&lt;p&gt;The Cloud Foundry CLI is a tool that allows developers, engineers e.t.c to interact with Cloud Foundry and any of its providers directly from their terminal. The Cloud Foundry CLI is the quickest way to interact or get started with Cloud Foundry. You can install the Cloud Foundry CLI by following the instructions &lt;a href="https://docs.cloudfoundry.org/cf-cli/install-go-cli.html"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once the CLI has been installed, you can confirm if it's available on your machine by going to your terminal and running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After executing the above command, the following will be displayed in your terminal:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ssYG7-LU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2AiVBdhFrhuC6HE2Fg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ssYG7-LU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2AiVBdhFrhuC6HE2Fg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With the Cloud Foundry CLI, you can carry out the following actions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Connect to the Cloud Foundry Marketplace for various services&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Push your application live.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Connect with any of Cloud Foundry's official and other commercial providers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;See all your downloaded plugins.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Cloud Foundry CLI is a very powerful tool that can do much more than the above listed and it is still being maintained by the Cloud Foundry Community with the latest major version being version &lt;a href="https://github.com/cloudfoundry/cli"&gt;seven(v7.0)&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Organizations and Spaces in Cloud Foundry
&lt;/h2&gt;

&lt;p&gt;Before we go further ahead, we would need to know what organizations and spaces in Cloud Foundry are so that we can better understand the Cloud Foundry deployment roles and permissions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Organizations
&lt;/h3&gt;

&lt;p&gt;An organization is like a group that consists of various users, resources, applications, and environments that belong to a particular organization. Each Organization can have a quota of resources allocated to them based on their subscription plan and organizations are billed separately based on the number of resources consumed by the organization.&lt;/p&gt;

&lt;h3&gt;
  
  
  Spaces
&lt;/h3&gt;

&lt;p&gt;A Space in Cloud Foundry is an environment that consists of different phases on application development. An organization can have various spaces for its applications like a development space, a staging space, or a production space based on their preference.&lt;/p&gt;

&lt;p&gt;For more information on organizations and space, you can check the Cloud Foundry official &lt;a href="https://docs.cloudfoundry.org/concepts/roles.html"&gt;documentation&lt;/a&gt; or this article by &lt;a href="https://nikgrozev.com/about/"&gt;Nikolay Grozev&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In the next and further sections, we'll be exploring the different ways we can connect to Cloud Foundry using a handful of its available commercial providers and distributions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Buildpacks&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;CF CLI&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;CF Dev&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Pivotal Web Services&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Stratos&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;IBM Cloud Foundry&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SUSE CAP&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Anynines public Paas&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Buildpacks
&lt;/h2&gt;

&lt;p&gt;Buildpacks are an important feature in Cloud Foundry, they provide a platform and runtime support for applications built with different languages to run efficiently on Cloud Foundry. &lt;/p&gt;

&lt;p&gt;Cloud Foundry automatically detects the language used to build your application when you push it, this is achieved with the power of Buildpacks. You can push an application with one or multiple buildpacks depending on the type of application you are deploying.&lt;/p&gt;

&lt;p&gt;You can configure your application's buildpack by putting the information for the buildpack inside a buildpack.yml file, Cloud Foundry will automatically detect this file and use the information in the file to deploy your application.&lt;/p&gt;

&lt;p&gt;Cloud Foundry includes a set of system buildpacks for common languages and frameworks, this &lt;a href="https://docs.cloudfoundry.org/buildpacks/system-buildpacks.html"&gt;table&lt;/a&gt; lists all the available system buildpacks.&lt;/p&gt;

&lt;p&gt;Apart from the available system buildpacks, you can create and customize a buildpack for your application, you can read more about this process &lt;a href="https://docs.cloudfoundry.org/buildpacks/developing-buildpacks.html"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Certain Cloud Foundry Certified providers like IBM also provide their own custom buildpacks for your application to run smoothly on their cloud platform.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cloud-Native Buildpacks
&lt;/h3&gt;

&lt;p&gt;Cloud-Native Buildpacks transform your application source code into images that can run on any cloud.&lt;/p&gt;

&lt;p&gt;Cloud-Native Buildpacks allow developers to ship applications that can run on any cloud platform including Cloud Foundry. Basically, they take an application source code and then convert it into images that allow them to run on the cloud. &lt;/p&gt;

&lt;p&gt;For more information please visit &lt;a href="https://buildpacks.io/"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Paketo Buildpacks
&lt;/h3&gt;

&lt;p&gt;Paketo Buildpacks are Cloud Native Buildpacks and it is a project of the Cloud Foundry Foundation. They are written in Go, and they provide runtime support for applications. They are not exclusive to just the Cloud Foundry community but it can be used by any Cloud service provider.&lt;/p&gt;

&lt;p&gt;Paketo Buildpacks currently has support for the following languages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Go&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Nodejs&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;.NET Core&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Java&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;PHP&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For more information about paketo buildpacks, visit its documentation &lt;a href="https://buildpacks.io/"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  CF Dev
&lt;/h2&gt;

&lt;p&gt;CF Dev is a distribution of Cloud Foundry that is meant to enable engineers or folks that want to try Cloud Foundry for the first time run Cloud Foundry directly on their machine without having to connect with an external service provider. It makes use- of native hypervisors and also comes packed with a fully functional BOSH Director and it gives developers the entire Cloud Foundry experience in a lightweight and very easy to install package. It is likely the best way to deploy Cloud Foundry on your local machine.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: The CF Dev Project is still being maintained but it is currently no longer receiving updates or being actively developed.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Installation Process
&lt;/h3&gt;

&lt;p&gt;The following commands are to be executed in a terminal in order to install CF Dev in your machine.&lt;/p&gt;

&lt;p&gt;CF Dev has a couple of system requirements that can be found in the README section of it's &lt;a href="https://github.com/cloudfoundry-incubator/cfdev"&gt;Github repository&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In order to install CF Dev you also need to have the CF CLI available on your machine, if you are yet to install it, please do. &lt;/p&gt;

&lt;p&gt;After installing the CF CLI, run the following command in your terminal to install the CF Dev plugin:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cf install-plugin &lt;span class="nt"&gt;-r&lt;/span&gt; CF-Community cfdev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To start the CF Dev Server on your machine, run the following command in your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cf dev start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For first time users, it takes a while to start the CF Dev but if all goes well the following will be displayed on your terminal window:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1M8HsBkt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2A4r5eUJGznWM9tFAy" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1M8HsBkt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2A4r5eUJGznWM9tFAy" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Follow the instructions that are displayed on your terminal window to login and get started with CF Dev.&lt;/p&gt;

&lt;p&gt;With CF Dev now installed and started on your machine, you can now enjoy the full Cloud Foundry experience directly from your terminal and your machine.&lt;/p&gt;

&lt;p&gt;For more information on CF Dev Installation processes and configuration, you can check it's FAQ page, &lt;a href="https://github.com/cloudfoundry-incubator/cfdev/blob/master/FAQ.md#can-i-configure-the-working-directory"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Stratos
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://stratos.app/"&gt;Stratos&lt;/a&gt; is an official Cloud Foundry Project, it is an open-source user interface for Cloud Foundry and Kubernetes. Stratos supports multiple cluster monitoring and management from just a single User Interface.&lt;/p&gt;

&lt;p&gt;Below is an image of how the Stratos Dashboard looks like when an application is deployed on it:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--w7gBRPGU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2ANBMhwVt0QHelWJpA" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--w7gBRPGU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2ANBMhwVt0QHelWJpA" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Benefits of Stratos
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Easily View Helm Charts and Workloads.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Easy Cloud Foundry Cluster Management including managing and deploying applications in the Cloud Foundry cluster.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Easy Customization to fit your team needs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Connect to other Cloud Foundry Commercial providers via endpoints.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Easy Access to Cloud Foundry Marketplace.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;View Application Logs.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Getting Started
&lt;/h3&gt;

&lt;p&gt;The quickest way to get started with Stratos is to deploy it as a Cloud Foundry with docker by running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;-p&lt;/span&gt; 4443:443 splatform/stratos:latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Note: Docker must be installed on your local machine.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;After running the above command, you'll see the following in your terminal:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--W1pDfSIE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2AOaxNjESbbkdunneO" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--W1pDfSIE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2AOaxNjESbbkdunneO" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next thing is to navigate to localhost:4443 to access the local Stratos app, the following screen will be displayed:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XGGa6B-M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2A92lcJrMkNPSlhsBP" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XGGa6B-M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2A92lcJrMkNPSlhsBP" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You'll be asked to log in either as a local admin or use a Cloud Foundry User Account and Authentication, read more on UAA &lt;a href="https://docs.cloudfoundry.org/uaa/index.html"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For the sake of this documentation, I'll log in as a local admin, and I'll be asked to create a password to login to my local admin account.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RU29GQlO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2AvLZtX9-MI6jJvHHk" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RU29GQlO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2AvLZtX9-MI6jJvHHk" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After creating the password, it'll take a few seconds to save the configuration, and automatically, you'll be logged in into the Stratos dashboard.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: Save the password you created because it'll be needed, if you need to log in again.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Connecting to Cloud Foundry via endpoints
&lt;/h3&gt;

&lt;p&gt;Now that we are all set up and logged in, let's connect to an external Cloud Foundry service. In this case, we'll be making use of anynines Public Paas.&lt;/p&gt;

&lt;p&gt;Firstly, we need to create an anynines account, you can do that &lt;a href="https://paas.anynines.com/"&gt;here&lt;/a&gt;. After doing that, log in, and let's get started.&lt;/p&gt;

&lt;p&gt;After registering and logging in into anynines and also Stratos, navigate to the endpoints tab on the sidebar of Stratos, click on it then click on the register endpoint + icon and then click on Cloud Foundry.&lt;/p&gt;

&lt;p&gt;Here is a visual demonstration of the process:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1GPCGfKm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AmgC0ZqadUndT33VWr5BGOQ.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1GPCGfKm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AmgC0ZqadUndT33VWr5BGOQ.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, we need to fill in the form, you can name the endpoint whatever you like and the endpoint address should be the address shown to you on the anynines dashboard.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eNedxPND--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2A9NI4c_hchhcuyzQ6" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eNedxPND--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2A9NI4c_hchhcuyzQ6" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After inputting the endpoint address, you can click on the register button at the bottom left corner of the screen.&lt;/p&gt;

&lt;p&gt;Here is a visual demonstration of the process:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DJvoJC4e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AClprNkstBaN1oGeeJeGTVg.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DJvoJC4e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AClprNkstBaN1oGeeJeGTVg.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After registering the endpoint, we can connect instantly by checking on the connect to the endpoint now checkbox and then fill in the username and password field with your anynines username and password and you'll be connected to anynines immediately.&lt;/p&gt;

&lt;p&gt;Here is a visual demonstration of the process:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mL3IJjS_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2AxsebtwrjKpK781rD" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mL3IJjS_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2AxsebtwrjKpK781rD" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's it! we have successfully connected to a Cloud Foundry endpoint. We can now view and manage all the applications that we deployed to Cloud Foundry with Stratos.&lt;/p&gt;

&lt;p&gt;For more information about Stratos, you can check the official &lt;a href="https://stratos.app/docs/"&gt;documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  SUSE Stratos Console
&lt;/h2&gt;

&lt;p&gt;Optionally, you can use the hosted version of Stratos customized by &lt;a href="https://www.suse.com/"&gt;SUSE&lt;/a&gt; called &lt;a href="https://stratos.cap.explore.suse.dev/home"&gt;SUSE Stratos Console&lt;/a&gt;. All you need to do is set up a free SUSE account, log in and you're good to go. It works exactly like the open-source Stratos Cloud Foundry &amp;amp; Kubernetes console but it comes with a few customizations and improvements.&lt;/p&gt;

&lt;p&gt;Here is an image of how the SUSE Stratos Console dashboard looks like when you are logged in:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ehIw82rI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2AHt2Ledh2ONT95qlT" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ehIw82rI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2AHt2Ledh2ONT95qlT" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: Your SUSE Stratos Console login details are the same with the free SUSE account you created.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  IBM Cloud Foundry
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.ibm.com/cloud/cloud-foundry"&gt;IBM Cloud Foundry&lt;/a&gt; is a distribution of Cloud Foundry built on top of the IBM Cloud. It allows enterprise developers to deploy and develop Cloud Foundry applications on the IBM Cloud platform.&lt;br&gt;
IBM Cloud Foundry gives developers access to enjoy the Cloud Foundry developer experience and the IBM Cloud experience at the same time.&lt;/p&gt;
&lt;h3&gt;
  
  
  Features of IBM Cloud Foundry
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;IBM Cloud Foundry has runtime support for various languages including Java, Nodejs, Ruby, Python etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Access to Cloud Foundry Community Buildpacks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Deploy and develop your applications quickly and it facilitates developing applications as stateless processes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Provides support for extending your application capabilities with external services.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Below is a gif of how the IBM Cloud Foundry Dashboard looks like when you are logged in on IBM Cloud.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--v5Ot1QC4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2AWVaAwuNOWWWtkNGr" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--v5Ot1QC4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2AWVaAwuNOWWWtkNGr" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Getting Started
&lt;/h3&gt;

&lt;p&gt;To get started with IBM Cloud Foundry, You can &lt;a href="https://cloud.ibm.com/registration"&gt;sign up&lt;/a&gt; for a free trial IBM Cloud account.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--W52IYlpa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2AsNsoglsKfIB-KqtP" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--W52IYlpa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2AsNsoglsKfIB-KqtP" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After registering and logging into your account you'll be redirected into the IBM Cloud dashboard.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NN6f5vQH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2A40wWewfvQ367MU_q" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NN6f5vQH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2A40wWewfvQ367MU_q" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After logging into the dashboard, click on the fourth icon on the dashboard and you'll be navigated to the IBM Cloud Foundry Dashboard.&lt;/p&gt;

&lt;p&gt;Here is a demonstration of the process:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HBMF_rbs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2Aoo_u8LCC8J8w_gsh2cbzYA.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HBMF_rbs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2Aoo_u8LCC8J8w_gsh2cbzYA.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that we've navigated to the dashboard, let's look at deploying applications on IBM Cloud Foundry.&lt;/p&gt;
&lt;h3&gt;
  
  
  Deploying an Application on IBM Cloud Foundry
&lt;/h3&gt;

&lt;p&gt;There are two main ways of deploying an application on IBM Cloud Foundry namely:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The command-line interface(IBM Cloud CLI)&lt;/li&gt;
&lt;li&gt;The integrated development environments (IDEs)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Additionally, you can use &lt;a href="https://cloud.ibm.com/docs/cloud-foundry-public?topic=cloud-foundry-public-deployingapps#appmanifest"&gt;app manifests&lt;/a&gt; to deploy your application on IBM Cloud Foundry, when you use an app manifest to deploy your application, you reduce the number of deployment details you need to specify on your CLI when you are deploying your application. &lt;/p&gt;

&lt;p&gt;All the CLI needs to do is read the content in your application manifest and use it to deploy your application immediately.&lt;/p&gt;

&lt;p&gt;To learn more about deploying applications on IBM Cloud Foundry, please visit its &lt;a href="https://medium.com/r/?url=https%3A%2F%2Fcloud.ibm.com%2Fdocs%2Fcloud-foundry-public%3Ftopic%3Dcloud-foundry-public-deployingapps"&gt;official documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: The fastest way to get started is to use the IBM Cloud CLI and install it on your machine by visiting &lt;a href="https://cloud.ibm.com/docs/cli?topic=cli-getting-started#step1-install-idt"&gt;here&lt;/a&gt;. Also, App Manifests are not just for IBM Cloud Foundry; all Cloud Foundry services and providers support the use of App Manifests to deploy your applications.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  anynines Public Paas
&lt;/h2&gt;

&lt;p&gt;Anynines Public PaaS (a9s) is a platform as a service that is built on top of Cloud Foundry. It is referred to as “The European Cloud Foundry Platform” because it uses a European datacenter.&lt;br&gt;
Some of its features include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fair pricing&lt;/li&gt;
&lt;li&gt;Easy and Quick deployments&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Anynines Public PaaS provides a customer panel in addition to the Cloud Foundry command line tool for managing your organizations, applications spaces, billing information and also uploading SSL certificates to protect your custom domains.&lt;/p&gt;
&lt;h3&gt;
  
  
  Supported Technologies and Services on anynines Public Paas
&lt;/h3&gt;

&lt;p&gt;The following are some of the supported technologies that can be deployed on the anynines PaaS:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ruby on Rails&lt;/li&gt;
&lt;li&gt;Tomcat&lt;/li&gt;
&lt;li&gt;Nodejs&lt;/li&gt;
&lt;li&gt;RACK&lt;/li&gt;
&lt;li&gt;Java&lt;/li&gt;
&lt;li&gt;Python&lt;/li&gt;
&lt;li&gt;Grails&lt;/li&gt;
&lt;li&gt;PHP&lt;/li&gt;
&lt;li&gt;Redis&lt;/li&gt;
&lt;li&gt;MySQL&lt;/li&gt;
&lt;li&gt;MongoDB&lt;/li&gt;
&lt;li&gt;PostgreSQL&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Getting started with anynines Public PaaS
&lt;/h3&gt;

&lt;p&gt;It is quite easy to get started with anynines Public PaaS, all you have to do is to &lt;a href="https://paas.anynines.com/signups/new"&gt;create&lt;/a&gt; a free anynines account and login into your anynines customer panel.&lt;/p&gt;

&lt;p&gt;Below is an image of how the a9s customer panel looks like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nYP5bnkk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2AX_z64IKy8mSvhyhf" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nYP5bnkk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2AX_z64IKy8mSvhyhf" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Deploying Applications on Cloud Foundry with anynines
&lt;/h3&gt;

&lt;p&gt;Deploying your application on anynines is very easy. All you need is the &lt;a href="https://docs.cloudfoundry.org/cf-cli/install-go-cli.html"&gt;Cloud Foundry CLI&lt;/a&gt; and the anynines target endpoint which can be found on the anynines customer panel.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6MOL0rto--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2AddZExpuGEwxrdn31" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6MOL0rto--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/0%2AddZExpuGEwxrdn31" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, navigate to your application folder in your terminal and connect the CF CLI with the anynines target and login with your anynines account login details by running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cf api https://api.de.a9s.eu
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is a visual demonstration of the process:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bFPJwnxQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AuHcPeMWbSS3VaMF_erXfrw.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bFPJwnxQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AuHcPeMWbSS3VaMF_erXfrw.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that you need to log into your anynines account in the Cloud Foundry CLI so that we can push our app. You can do that with the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cf login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is a visual demonstration of the process:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yeA1pZ8v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2A2UyyxRFBSobvud3jyKqfmA.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yeA1pZ8v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2A2UyyxRFBSobvud3jyKqfmA.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that we are logged in, all we need to do is to run the &lt;strong&gt;&lt;em&gt;cf push&lt;/em&gt;&lt;/strong&gt; command and our application will be deployed.&lt;/p&gt;

&lt;p&gt;After deploying our application, we can alternatively use any of the Cloud Foundry console user interfaces like Stratos or SUSE Stratos console to directly interact with applications deployed on the Cloud Foundry cluster via the anynines target endpoint.&lt;/p&gt;

&lt;p&gt;For more information on the anynines Public PaaS, check out their &lt;a href="https://paas.anynines.com/"&gt;official website&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Cloud Foundry has a wide range of services and providers that can be used by individual developers and large scale enterprises. Using Cloud Foundry eliminates the stress of ops, gives you flexibility and provides a proven developer experience for Kubernetes.&lt;/p&gt;

&lt;p&gt;What features, concepts or providers of Cloud Foundry do you find interesting? Let us know in the comments section.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Cloud Foundry Summit Europe 2020 is built by and for the Cloud Foundry community. Whether you're new to Cloud Foundry, you're a long-time contributor building the platform, or you're using Cloud Foundry to attain your business goals, Cloud Foundry Summit is the place to collaborate with other developers, operators, CIOs and IT professionals to shape the future of the project, share best practices and innovate together.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dates: Oct 21st &amp;amp; 22nd 2020&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;The best way to connect with the Cloud Foundry community is to join our Slack Workspace at (&lt;a href="https://slack.cloudfoundry.org/"&gt;https://slack.cloudfoundry.org/&lt;/a&gt;). Those in the Slack community help you get quickly connected with other members or someone from the Cloud Foundry Foundation.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>cloudfoundry</category>
      <category>cloud</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Deploy a Nodejs App to Cloud Foundry</title>
      <dc:creator>akintayo shedrack</dc:creator>
      <pubDate>Thu, 27 Aug 2020 13:19:24 +0000</pubDate>
      <link>https://dev.to/cloudfoundry/deploy-a-nodejs-app-to-cloud-foundry-52em</link>
      <guid>https://dev.to/cloudfoundry/deploy-a-nodejs-app-to-cloud-foundry-52em</guid>
      <description>&lt;p&gt;I recently joined the Cloud Foundry Foundation as a Developer Advocate and I've been learning about the &lt;a href="http://cloudfoundry.org/"&gt;Cloud Foundry&lt;/a&gt; project lately and it's been a great experience so far. Most recently, I successfully deployed an existing Nodejs application on Cloud Foundry via one of its commercial distribution called &lt;a href="https://run.pivotal.io"&gt;Pivotal Web Services&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;This tutorial will cover how I was able to deploy a Nodejs application on Cloud Foundry via Pivotal Web Services.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Cloud Foundry?
&lt;/h2&gt;

&lt;p&gt;According to its official website, Cloud Foundry is an open-source platform that allows application development teams to build, test, deploy, and scale applications. &lt;/p&gt;

&lt;p&gt;It also provides an underlying infrastructure including Kubernetes, developer frameworks, and application services.&lt;/p&gt;

&lt;p&gt;Cloud Foundry is known for its awesome developer experience. The project is backed by Google, IBM, Microsoft, VMware (owners of Pivotal Web Services), SAP, SUSE, and more.&lt;/p&gt;

&lt;p&gt;Cloud Foundry takes the workload off developers and lets them ​​focus on only the application code and business outcomes by making all those tasking deployment processes disappear.&lt;/p&gt;

&lt;p&gt;In summary, Cloud Foundry takes ​away the burden of managing complexity and running containerized workloads of an application from developers and allows them to worry or stay focused on application code and the business outcomes. Asides from just taking away the burden, it also provides benefits. For example, packing and containerization come free.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Pivotal Web Services
&lt;/h2&gt;

&lt;p&gt;Pivotal Web Services (PWS) is a hosted version of the VMware Tanzu Application Service(formerly known as Pivotal Cloud Foundry).&lt;/p&gt;

&lt;p&gt;The VMware Tanzu Application Service is a distribution of the open-source Cloud Foundry platform that includes additional features and services that expand the capabilities of Cloud Foundry. It is commercially available for everyone, and it is ready to use.&lt;/p&gt;

&lt;p&gt;For this tutorial, we would need to create a Pivotal Web Services account and you can do that &lt;a href="http://run.pivotal.io"&gt;here&lt;/a&gt;, follow the link and sign up.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deploying a Nodejs Application
&lt;/h2&gt;

&lt;p&gt;After signing up on Pivotal and you have successfully logged in, you'll be asked to select "where to", click on Pivotal Web Services and you'll be taken to the Pivotal Web Services console.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dM7XFy2w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AFgCVvwGHR_ruAwj0fpbRcw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dM7XFy2w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AFgCVvwGHR_ruAwj0fpbRcw.png" alt="Where To"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, you'll be directly taken to the console where you'll be asked to create a company, this company will serve as your organization name and it can be named anything. Go ahead and fill in the company name and start a free trial.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Qj1gUMoA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2At40Zmz3d21DWOA6eSNTjDQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Qj1gUMoA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2At40Zmz3d21DWOA6eSNTjDQ.png" alt="Sign up for free trial screen"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After you click on start free trial, you'll be taken to another process where you'll need to select your country and verify your phone number for security reasons. Fill the input fields and click on send my code, a six-digit code will be sent to you and you'll use this code to verify your account.&lt;br&gt;
If all goes well with the verification, you'll be taken to the last process of verification where you'll need to create an organization, an organization (org) is a development account that encompasses computing resources, apps, and services. It can be owned and used by an individual or multiple collaborators.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--a06q2YCI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AJPcXmFUyu_irHF43vsPhZQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--a06q2YCI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AJPcXmFUyu_irHF43vsPhZQ.png" alt="Create a Trial Org Screen"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now go ahead and name your organization whatever you choose to name it and click on Start Free Trial. (I named my organization "demo-12" ).&lt;br&gt;
Now, you should see your PWS console with your organization name, and the space you created, in my case "development", will be displayed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ldrdnvz9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2A0Ulv668kZ0TCeXZDG99Now.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ldrdnvz9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2A0Ulv668kZ0TCeXZDG99Now.png" alt="My PWS console page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Next thing we'll need to do is to go to our terminal and install the Cloud Foundry CLI, we'll be using the official Cloud Foundry CLI to interact with our Pivotal Web Services console.&lt;/p&gt;

&lt;p&gt;To install the Cloud Foundry CLI, please visit &lt;a href="https://docs.cloudfoundry.org/cf-cli/install-go-cli.html"&gt;here&lt;/a&gt; to find the installation instructions for your preferred operating system.&lt;/p&gt;
&lt;h2&gt;
  
  
  Interacting with the Cloud Foundry Official CLI
&lt;/h2&gt;

&lt;p&gt;After you have successfully installed the Cloud Foundry CLI, in other to confirm that it's available on your machine, please run the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After running the command above, If it shows what it is displayed in the image below then the CLI is installed on your machine. If it doesn't you should try to go over the installation processes again.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TUSEygck--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AvjNKtktJHqzVeT58SAViFA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TUSEygck--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AvjNKtktJHqzVeT58SAViFA.png" alt="CF command display on Terminal"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Login to Our Pivotal Web Services Development Space
&lt;/h3&gt;

&lt;p&gt;The next thing to do is that we need to is to log into our Pivotal Web Services development space so that we can have direct access to our console right from our terminal. &lt;br&gt;
To login run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cf login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After running that command, you'll be asked for the API endpoint, type in &lt;a href="https://api.run.pivotal.io"&gt;https://api.run.pivotal.io&lt;/a&gt;, and press Enter.&lt;/p&gt;

&lt;p&gt;You'll then be asked for the email address and password you used to create your PWS account, type that in and you'll be logged in if all your credentials are correct.&lt;/p&gt;

&lt;p&gt;Below is an image of what the end of the process should look like.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--E-zxt-Vj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AqPfO1kacX4L52pj96L6V6Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--E-zxt-Vj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AqPfO1kacX4L52pj96L6V6Q.png" alt="Cf Login Result on Terminal"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have not noticed already, the CLI shows the organization and space we created and that is available on our account.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Power of CF Push
&lt;/h3&gt;

&lt;p&gt;We can easily deploy our app to Cloud Foundry with just this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cf push &amp;lt;app name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Where the  should contain the name we want to give our application.&lt;/p&gt;

&lt;p&gt;After running the command above it goes through a series of processes and it usually takes a while during the initial deployment, so sit back and relax.&lt;/p&gt;

&lt;p&gt;If the deployment is carried out successfully, you should see the following details on your terminal:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--M6emK99p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AFzFeMK6Bf7hKt0YtWIJrGw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--M6emK99p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AFzFeMK6Bf7hKt0YtWIJrGw.png" alt="Deployment Successful on Terminal"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you get something similar to the above image on your terminal, it means the deployment was successful.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Happens When We Run cf push
&lt;/h2&gt;

&lt;p&gt;Let's quickly run through the processes that were carried out when we run the cf push command.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;The application manifest (manifest.yml) is pushed to the space specified on PWS.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The application information is also recognized and pulled &lt;br&gt;
in by the Cloud Foundry CLI.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A route for our application is created, this is the auto-generated link where we can see our application live.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The application files are uploaded on cloud foundry.&lt;br&gt;
The application-specific buildpack will be recognized and loaded based on the buildpack.yml file.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The application is uploaded completely in various steps.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The application is started and can be seen live using the auto-generated route link.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The application environmental variables will be injected into the application if we have specified some. We can specify environmental variables by running the following command:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cf set-env APP_NAME ENV_VAR_NAME ENV_VAR_VALUE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;APP_NAME = The application name specified in the manifest.yml file.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;ENV_VAR_NAME = The environmental variable name.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;ENV_VAR_VALUE = The environmental variable value.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Viewing Our Application Live
&lt;/h2&gt;

&lt;p&gt;In other to see our application live, we have to confirm on the PWS console that our app is running. We can see that in the space where the app will be pushed. &lt;/p&gt;

&lt;p&gt;Here is an image of the PWS console now that we've deployed our application.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LMb2kAQC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AVWQt9KbAmtL0Ww-Exq8sjA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LMb2kAQC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AVWQt9KbAmtL0Ww-Exq8sjA.png" alt="PWS Console + Application Running"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If we should visit the route generated, we should see our application deployed live. &lt;/p&gt;

&lt;p&gt;Here is an image of how our application looks like when deployed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4HH9DkBm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2A7jX-uYyLGpbIVGvacFmJ3w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4HH9DkBm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2A7jX-uYyLGpbIVGvacFmJ3w.png" alt="Our Deployed Application Live!"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And that's it, we have successfully deployed a nodejs application on Cloud Foundry via the Pivotal Web Services console and the Cloud Foundry CLI.&lt;/p&gt;

&lt;h2&gt;
  
  
  Starting &amp;amp; Stopping Our Application
&lt;/h2&gt;

&lt;p&gt;If you decide to stop your application from running at any point, you can do this by running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cf stop &amp;lt;app name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above command will stop our application from running. We can always restart our application by running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cf start &amp;lt;app name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Extra Configuration For Our Application.
&lt;/h2&gt;

&lt;p&gt;In other to prepare our application for large scale deployment, we need to create files that will allow Cloud Foundry to recognize the technology used to build our application and also allow us specify custom setting like Memory Size etc. &lt;/p&gt;

&lt;p&gt;Just like Heroku, it uses buildpacks to carry this process out and now we will need to specify the proper buildpack for our application which is the nodejs buildpack.&lt;/p&gt;

&lt;p&gt;We are doing this because we need our application to be deployed without stress and also just in case we need some extra or custom settings or specifications for our app deployment.&lt;/p&gt;

&lt;p&gt;In our application, we need to create two files &lt;em&gt;manifest.yml&lt;/em&gt; and &lt;em&gt;buildpack.yml&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;The buildpack.yml file will hold all the configuration details for the buildpack we use for our application, read more about it &lt;a href="https://docs.cloudfoundry.org/buildpacks/custom.html"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The mainifest.yml file will hold certain deployment information about our application, read more about this &lt;a href="https://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In my case this the content of my manifest.yml file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;applications&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;exchange-rate-spa&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;node server.js&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;memory&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;512M&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is also the content of my buildpack.yml file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;nodejs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;13.x&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Possible Errors You Could Encounter While Deploying a Nodejs Application on Cloud Foundry Via Pivotal
&lt;/h2&gt;

&lt;p&gt;Here are a couple of errors I encountered while trying to deploy a node app for the first time with cf push and how I was able to fix them.&lt;/p&gt;

&lt;p&gt;Error 1.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Failed; The resource file mode is invalid: File mode '444' with path 'npm-cache/_cacache/content-v2/sha1/8a/03/9d2d1021d22d1ea14c80d8ea468ba2ef3fcc' is invalid. Minimum file mode is '0600' FAILED
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Fix 1:&lt;/strong&gt; Change the permissions of the app folder with and try to cf push again&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;chmod&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; 700 &lt;span class="k"&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Fix 2:&lt;/strong&gt; If Fix 1 doesn't work, check if you're using the right PWS distribution or create a .cfignore file and add node_modules/.cache.&lt;/p&gt;

&lt;p&gt;Error 2.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Error staging application: App staging failed in the buildpack compile phase
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; Check if the version of nodejs in package.json and buildpack.yml is the same thing and also make sure you're using a compatible version of node.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;We have successfully deployed a nodejs and it was a pretty interesting process. You can learn more about deploying nodejs apps on Cloud Foundry by reading the &lt;a href="https://docs.cloudfoundry.org/buildpacks/node/node-tips.html"&gt;official documentation&lt;/a&gt;. &lt;br&gt;
Cloud Foundry really makes it easy to scale and deploy your applications, if you have a favourite feature of Cloud Foundry let us know in the comments section.&lt;/p&gt;

&lt;p&gt;The supporting repo for this article can be found &lt;a href="https://github.com/hacktivist123/Exchange-Value"&gt;here&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Cloud Foundry Summit Europe 2020 is built by and for the Cloud Foundry community. Whether you're new to Cloud Foundry, you're a long-time contributor building the platform, or you're using Cloud Foundry to attain your business goals, Cloud Foundry Summit is the place to collaborate with other developers, operators, CIOs and IT professionals to shape the future of the project, share best practices and innovate together.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dates: Oct 21st &amp;amp; 22nd 2020&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;The best way to connect with the Cloud Foundry community is to join our Slack Workspace at (&lt;a href="https://slack.cloudfoundry.org/"&gt;https://slack.cloudfoundry.org/&lt;/a&gt;). Those in the Slack community help you get quickly connected with other members or someone from the Cloud Foundry Foundation.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>cloudfoundry</category>
      <category>kubernetes</category>
      <category>node</category>
    </item>
  </channel>
</rss>
