You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -189,7 +189,7 @@ if (process.env.VCAP_SERVICES) {
189
189
checks if the app is running in the cloud. If not, it falls back to the default local MongoDB url. This allows you to run your app locally as well as in the cloud without having to configure anything differently. So let's push it to the cloud using
190
190
191
191
<preclass="terminal">
192
-
$ cf push my-node-app
192
+
$ cf push my-nodejs-app
193
193
</pre>
194
194
195
195
You can access other services like Redis or MariaDB in a similar matter, simply by binding them to your app and accessing them through the environment variables.
Copy file name to clipboardExpand all lines: deploy.html.md.erb
+7-7
Original file line number
Diff line number
Diff line change
@@ -10,18 +10,18 @@ In this step you will deploy the app to <%= vars.product_full %>.
10
10
Push your app to the cloud by executing the following command and replacing the "my-random-hostname" with your own hostname. This will be part of the URL your app will be reached at and it has to be globally unique so be creative. The `-m 128M` tells Cloud Foundry to use 128MB of memory for our app which should be plenty.
Copy file name to clipboardExpand all lines: environment.html.md.erb
+4-4
Original file line number
Diff line number
Diff line change
@@ -10,17 +10,17 @@ owner: Tobias Fuhrimann
10
10
At runtime, environment variables are exposed to the application through its environment. You can use these for example to run Node.js in production mode setting the `NODE_ENV` environment variable.
11
11
12
12
<preclass="terminal">
13
-
$ cf set-env my-node-app NODE_ENV production
14
-
Setting env variable 'NODE_ENV' to 'production' for app my-node-app in org MyOrg / space MySpace as [email protected]...
13
+
$ cf set-env my-nodejs-app NODE_ENV production
14
+
Setting env variable 'NODE_ENV' to 'production' for app my-nodejs-app in org MyOrg / space MySpace as [email protected]...
15
15
OK
16
16
TIP: Use 'cf restage' to ensure your env variable changes take effect
17
17
</pre>
18
18
19
19
Then restage your app as suggested using
20
20
21
21
<preclass="terminal">
22
-
$ cf restage my-node-app
23
-
Restaging app my-node-app in org MyOrg / space MySpace as [email protected]...
22
+
$ cf restage my-nodejs-app
23
+
Restaging app my-nodejs-app in org MyOrg / space MySpace as [email protected]...
Copy file name to clipboardExpand all lines: index.html.md.erb
+4
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,10 @@ The tutorial assumes that you have an <a href="https://console.developer.swissco
13
13
14
14
Furthermore, you must have a first Cloud Foundry <ahref="../concepts/roles.html#orgs" target="_blank">Organization</a> and <ahref="../concepts/roles.html#spaces" target="_blank">Space</a> to push your apps to. In case you don't have that yet, please follow the <ahref="https://console.developer.swisscom.com" target="_blank">tutorials in the web console</a> before returning here.
15
15
16
+
<pclass="note">
17
+
<strong>Note</strong>: In case you are stuck during the tutorial, you can always check out the <ahref="https://github.com/swisscom/cf-sample-app-nodejs/tree/final-result" target="_blank"><code>final-result</code></a> branch of the sample app repo to see what your code should look like.
18
+
</p>
19
+
16
20
<divstyle="text-align:center;margin:3em;">
17
21
<ahref="./set-up.html" class="btn btn-primary">I'm ready to start</a>
Copy file name to clipboardExpand all lines: manifest.html.md.erb
+2-2
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ It's tedious to keep having to specify the app name and other variables each tim
10
10
```yaml
11
11
---
12
12
applications:
13
-
- name: my-node-app
13
+
- name: my-nodejs-app
14
14
memory: 128MB
15
15
instances: 1
16
16
@@ -23,7 +23,7 @@ applications:
23
23
NODE_ENV: production
24
24
```
25
25
26
-
The file tells Cloud Foundry that this is an application with the name `my-node-app` and the specifications made above. This means that from now on, you'll be able to push your App with the simple command:
26
+
The file tells Cloud Foundry that this is an application with the name `my-nodejs-app` and the specifications made above. This means that from now on, you'll be able to push your App with the simple command:
You now have a functioning git repository that contains a simple <ahref="https://expressjs.com/" target="_blank">Express</a> application as well as a `package.json` file, which is used by Node’s dependency manager npm.
Copy file name to clipboardExpand all lines: scale.html.md.erb
+7-7
Original file line number
Diff line number
Diff line change
@@ -10,8 +10,8 @@ Currently, your app is running as a single instance with 128MB of memory.
10
10
You can check how many instances are running and how much memory they have using the `cf scale` command:
11
11
12
12
<preclass="terminal">
13
-
$ cf scale my-node-app
14
-
Showing current scale of app my-node-app in org MyOrg / space MySpace as [email protected]...
13
+
$ cf scale my-nodejs-app
14
+
Showing current scale of app my-nodejs-app in org MyOrg / space MySpace as [email protected]...
15
15
OK
16
16
17
17
memory: 128M
@@ -26,8 +26,8 @@ By default, your app is deployed as one instance. Each instance runs in a separa
26
26
Scaling an application horizontally on <%=vars.product_full%> is equivalent to changing the number of instances that are running. Scale the number of instances to 3:
27
27
28
28
<preclass="terminal">
29
-
$ cf scale my-node-app -i 3
30
-
Scaling app my-node-app in org MyOrg / space MySpace as [email protected]...
29
+
$ cf scale my-nodejs-app -i 3
30
+
Scaling app my-nodejs-app in org MyOrg / space MySpace as [email protected]...
31
31
OK
32
32
</pre>
33
33
@@ -36,11 +36,11 @@ OK
36
36
Scaling an application vertically on <%=vars.product_full%> is equivalent to changing the amount of memory each instance has. Scale the amount of memory to 256MB:
37
37
38
38
<preclass="terminal">
39
-
$ cf scale my-node-app -m 256M
39
+
$ cf scale my-nodejs-app -m 256M
40
40
41
-
This will cause the app to restart. Are you sure you want to scale my-node-app?> yes
41
+
This will cause the app to restart. Are you sure you want to scale my-nodejs-app?> yes
42
42
43
-
Scaling app my-node-app in org MyOrg / space MySpace as [email protected]...
43
+
Scaling app my-nodejs-app in org MyOrg / space MySpace as [email protected]...
0 commit comments