Download and Prepare App for Cloud Foundry Deployment
- What a typical small Node.js app looks like
- What a Cloud Foundry deployment descriptor contains
In this tutorial, you’ll download a simple Node.js app from GitHub that returns an index page with various information about itself, in response to an HTTP request. You’ll open up and edit the app’s deployment descriptor, a file containing information about the app, including memory requirements, hostname and more.
- Step 1
- Step 2
This tutorial is preparing the app for deployment to the SAP BTP, Cloud Foundry runtime, and you’ll be deploying it (in another tutorial) from your own machine. So you’ll need to download the repository first.
Choose Clone or download and then choose Download ZIP.
Enter the name of the file you just downloaded and choose Validate.
- Step 3
Open the zip file and extract its content to a folder on your local computer. You will have extracted a folder named
- Step 4
The sample app repository contains a basic deployment descriptor, but you’ll need to edit it before the deployment. The deployment descriptor is the file called
manifest.ymlin the root of the app folder structure.
manifest.ymlfile with an editor of your choice.
What is the value of the
nameparameter that exists already in the
- Step 5
The host name for your app must be unique within a combination of region and runtime, in that it forms the most significant part of the fully qualified hostname in the app’s URL space. For example, if your app host name is
myapp, the fully qualified hostname for the Cloud Foundry runtime in the
EU10region will be:
If someone else is already using that hostname within that region and runtime, you won’t be able to deploy your application.
Add a parameter named
manifest.ymlfile and provide a unique value. For example, use your birth date or a random number or string. The contents of the file should look something like this when you’re done (and don’t forget to save your changes!):yamlCopy
--- applications: - name: cf-nodejs memory: 192M instances: 1 random-route: false host: my-unique-app-name-12345
The YAML format uses whitespace significantly – make sure you add this new parameter correctly, as shown.
Why does the host parameter need to be unique?