Skip to content

Commit 0d8e541

Browse files
authored
Merge pull request #18465 from Joysie/master
Automatic commit: Move 'btp-cf-buildpacks-node-create' from QA to Production
2 parents 9979526 + 10e5b14 commit 0d8e541

File tree

1 file changed

+26
-22
lines changed

1 file changed

+26
-22
lines changed

tutorials/btp-cf-buildpacks-node-create/btp-cf-buildpacks-node-create.md

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ primary_tag: programming-tool>node-js
1010
---
1111

1212
## Prerequisites
13-
- You have registered for a Cloud Foundry [trial account] (hcp-create-trial-account) on SAP Business Technology Platform.
13+
- You have a productive account for SAP Business Technology Platform (SAP BTP). If you don't have such yet, you can create one so you can [try out services for free] (https://developers.sap.com/tutorials/btp-free-tier-account.html).
14+
- You have created a subaccount and a space on Cloud Foundry Environment.
1415
- [cf CLI] (https://help.sap.com/products/BTP/65de2977205c403bbc107264b8eccf4b/4ef907afb1254e8286882a2bdef0edf4.html) is installed locally.
1516
- [Node.js] (https://nodejs.org/en/about/releases/) and [npm] (https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) are installed locally.
1617
- You have installed an integrated development environment, for example [Visual Studio Code] (https://code.visualstudio.com/).
@@ -28,27 +29,30 @@ This tutorial will guide you through creating and setting up a simple Node.js ap
2829

2930
[ACCORDION-BEGIN [Step 1: ](Log on to SAP BTP)]
3031

31-
First, you need to connect to the SAP BTP, Cloud Foundry environment with your trial account. By default, a space `dev` is created for you. Your Cloud Foundry URL depends on the region where the API endpoint belongs to. To find out which one is yours, see: [Regions and API Endpoints Available for the CF Environment] (https://help.sap.com/products/BTP/65de2977205c403bbc107264b8eccf4b/f344a57233d34199b2123b9620d0bb41.html?version=Cloud) -> **Regions for Trial Accounts**.
32+
First, you need to connect to the SAP BTP, Cloud Foundry environment with your productive subaccount. Your Cloud Foundry URL depends on the region where the API endpoint belongs to. To find out which one is yours, see: [Regions and API Endpoints Available for the CF Environment] (https://help.sap.com/products/BTP/65de2977205c403bbc107264b8eccf4b/f344a57233d34199b2123b9620d0bb41.html?version=Cloud)
3233

33-
In this tutorial, we use `eu10.hana.ondemand.com` as an example.
34+
In this tutorial, we use `eu20.hana.ondemand.com` as an example.
3435

3536
1. Open a command-line console.
3637

37-
2. Set the Cloud Foundry API endpoint for your trial account. Execute (using your actual region URL):
38+
2. Set the Cloud Foundry API endpoint for your subaccount. Execute (using your actual region URL):
3839

3940
```Bash/Shell
40-
cf api https://api.cf.eu10.hana.ondemand.com
41+
cf api https://api.cf.eu20.hana.ondemand.com
4142
```
4243
3. Log in to SAP BTP, Cloud Foundry environment:
4344
4445
```Bash/Shell
4546
cf login
4647
```
4748
48-
4. When prompted, enter your user credentials – the email and password you have used to register your SAP BTP trial account.
49+
4. When prompted, enter your user credentials – the email and password you have used to register your productive SAP BTP account.
4950
5051
> **IMPORTANT**: If the authentication fails, even though you've entered correct credentials, try [logging in via single sign-on] (https://help.sap.com/products/BTP/65de2977205c403bbc107264b8eccf4b/e1009b4aa486462a8951c4d499ce6d4c.html?version=Cloud).
5152
53+
#### RESULT
54+
55+
Details about your personal SAP BTP subaccount are displayed (API endpoint, user, organization, space).
5256
5357
[DONE]
5458
[ACCORDION-END]
@@ -68,17 +72,17 @@ You're going to create a simple Node.js application.
6872
applications:
6973
- name: myapp
7074
routes:
71-
- route: node-1234567trial.cfapps.eu10.hana.ondemand.com
75+
- route: node-1234-aaaa-5678.cfapps.eu20.hana.ondemand.com
7276
path: myapp
7377
memory: 128M
7478
buildpack: nodejs_buildpack
7579
```
7680
7781
The `manifest.yml` file represents the configuration describing your application and how it will be deployed to Cloud Foundry.
7882
79-
> **IMPORTANT**: Make sure you don't have another application with the name `myapp` in your `dev` space.
83+
> **IMPORTANT**: Make sure you don't have another application with the name `myapp` in your space! If you do, use a different name and adjust the whole tutorial according to it.
8084
81-
> Also bear in mind that your application's technical name (in the route) must be **unique** in the whole Cloud Foundry landscape. We advice that you use your trial account ID to construct the technical name. In this tutorial, we use: `node-1234567trial`
85+
> Also bear in mind that your application's technical name (in the route) must be **unique** in the whole Cloud Foundry landscape. We advice that you use, for example, your subdomain name or part of your subaccount ID to construct the technical name. In this tutorial, we use: `node-1234-aaaa-5678`
8286
8387
4. Inside `node-tutorial`, create a subfolder `myapp`.
8488
@@ -98,7 +102,7 @@ You're going to create a simple Node.js application.
98102
99103
This operation adds the `express` package as a dependency in the `package.json` file.
100104
101-
After the installation is complete, the content of `package.json` should look like this:
105+
After the installation is completed, the content of `package.json` should look like this:
102106
103107
```JSON
104108
{
@@ -112,7 +116,7 @@ You're going to create a simple Node.js application.
112116
"author": "",
113117
"license": "ISC",
114118
"dependencies": {
115-
"express": "^4.17.3"
119+
"express": "^4.18.1"
116120
}
117121
}
118122
```
@@ -134,7 +138,7 @@ You're going to create a simple Node.js application.
134138
"author": "",
135139
"license": "ISC",
136140
"dependencies": {
137-
"express": "^4.17.3"
141+
"express": "^4.18.1"
138142
}
139143
}
140144
```
@@ -169,7 +173,7 @@ You're going to create a simple Node.js application.
169173
170174
11. Now open a browser window and enter the URL of the `myapp` application (see the route).
171175
172-
That is: `https://node-1234567trial.cfapps.eu10.hana.ondemand.com`
176+
That is: `https://node-1234-aaaa-5678.cfapps.eu20.hana.ondemand.com`
173177
174178
#### RESULT
175179
@@ -205,7 +209,7 @@ Authentication in the SAP BTP, Cloud Foundry environment is provided by the Auth
205209
applications:
206210
- name: myapp
207211
routes:
208-
- route: node-1234567trial.cfapps.eu10.hana.ondemand.com
212+
- route: node-1234-aaaa-5678.cfapps.eu20.hana.ondemand.com
209213
path: myapp
210214
memory: 128M
211215
buildpack: nodejs_buildpack
@@ -217,7 +221,7 @@ Authentication in the SAP BTP, Cloud Foundry environment is provided by the Auth
217221
218222
4. Now you have to create a microservice (the application router). Go to the `node-tutorial` folder and create a subfolder `web`.
219223
220-
> **IMPORTANT**: Make sure you don't have another application with the name `web` in your `dev` space!
224+
> **IMPORTANT**: Make sure you don't have another application with the name `web` in your space! If you do, use a different name and adjust the rest of the tutorial according to it.
221225
222226
5. Inside the `web` folder, create a subfolder `resources`. This folder will provide the business application's static resources.
223227
@@ -259,29 +263,29 @@ Authentication in the SAP BTP, Cloud Foundry environment is provided by the Auth
259263
},
260264
```
261265
262-
10. Now you need to add the `web` application to your project and bind the XSAUAA service name (`nodeuaa`) to it. To do that, insert the following content **at the end** of your `manifest.yml` file.
266+
10. Now you need to add the `web` application to your project and bind the XSUAA service instance (`nodeuaa`) to it. To do that, insert the following content **at the end** of your `manifest.yml` file.
263267
264268
265269
```YAML
266270
- name: web
267271
routes:
268-
- route: web-1234567trial.cfapps.eu10.hana.ondemand.com
272+
- route: web-1234-aaaa-5678.cfapps.eu20.hana.ondemand.com
269273
path: web
270274
memory: 128M
271275
env:
272276
destinations: >
273277
[
274278
{
275279
"name":"myapp",
276-
"url":"https://node-1234567trial.cfapps.eu10.hana.ondemand.com",
280+
"url":"https://node-1234-aaaa-5678.cfapps.eu20.hana.ondemand.com",
277281
"forwardAuthToken": true
278282
}
279283
]
280284
services:
281285
- nodeuaa
282286
```
283287
284-
>Here you can follow the same pattern for constructing the technical name of the `web` application - by using your trial account ID.
288+
Here you can follow the same pattern for constructing the technical name of the `web` application - by using your subaccount ID.
285289
286290
11. In the `web` folder, create an `xs-app.json` file with the following content:
287291
@@ -353,7 +357,7 @@ Authentication in the SAP BTP, Cloud Foundry environment is provided by the Auth
353357
354358
14. Open a new browser tab or window, and enter the URL of the `web` application.
355359
356-
That is: `https://web-1234567trial.cfapps.eu10.hana.ondemand.com`
360+
That is: `https://web-1234-aaaa-5678.cfapps.eu20.hana.ondemand.com`
357361
358362
15. Enter the credentials for your SAP BTP user.
359363
@@ -573,7 +577,7 @@ To get permissions, you need to create a role collection containing the roles `V
573577
574578
[ACCORDION-BEGIN [Step 5: ](Assigning Roles to a User in SAP BTP Cockpit)]
575579
576-
1. Open the SAP BTP cockpit and go to your trial account.
580+
1. Open the SAP BTP cockpit and go to your subaccount.
577581
578582
2. From the left-side menu, navigate to `Security` > `Role Collections`.
579583
@@ -595,7 +599,7 @@ To get permissions, you need to create a role collection containing the roles `V
595599
596600
> Now you need to apply these changes to the `myapp` application by redeploying it again.
597601
598-
10. Go back to the command line, and in the `node-tutorial` directory, execute:
602+
10. Go back to the command line, and in the `node-tutorial` directory execute:
599603
600604
```Bash/Shell
601605
cf push

0 commit comments

Comments
 (0)