Skip to content

Commit c0a5533

Browse files
author
Tobias Fuhrimann
committed
Rename node to nodejs
1 parent 8e107d8 commit c0a5533

11 files changed

+41
-37
lines changed

bind-service.html.md.erb

+6-6
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ This creates a small MongoDB database for you which we now have to bind to our a
2424
Let's bind the new service to our existing application:
2525

2626
<pre class="terminal">
27-
$ cf bind-service my-node-app my-mongodb
28-
Binding service my-mongodb to app my-node-app in org MyOrg / space MySpace as [email protected]...
27+
$ cf bind-service my-nodejs-app my-mongodb
28+
Binding service my-mongodb to app my-nodejs-app in org MyOrg / space MySpace as [email protected]...
2929
OK
30-
TIP: Use 'cf restage my-node-app' to ensure your env variable changes take effect
30+
TIP: Use 'cf restage my-nodejs-app' to ensure your env variable changes take effect
3131
</pre>
3232

3333
<p class="note">
@@ -37,7 +37,7 @@ TIP: Use 'cf restage my-node-app' to ensure your env variable changes take effec
3737
After that we restage the application as suggested so that it includes the new credentials in its environment variables:
3838

3939
<pre class="terminal">
40-
$ cf restage my-node-app
40+
$ cf restage my-nodejs-app
4141
Restaging app my-app in org MyOrg / space MySpace as [email protected]...
4242
-----> Downloaded app package (8.0K)
4343
-------> Buildpack version 1.5.8
@@ -50,7 +50,7 @@ Now we want to consume our new MongoDB from within our application. Use npm to a
5050

5151
<pre class="terminal">
5252
$ npm install --save mongoose
53-
cf-sample-app-node@0.0.0 /.../cf-sample-app-node
53+
cf-sample-app-nodejs@0.0.0 /.../cf-sample-app-nodejs
5454
5555
5656
@@ -189,7 +189,7 @@ if (process.env.VCAP_SERVICES) {
189189
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
190190

191191
<pre class="terminal">
192-
$ cf push my-node-app
192+
$ cf push my-nodejs-app
193193
</pre>
194194

195195
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.

dependencies.html.md.erb

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The demo app you deployed already has a `package.json`, and it looks something l
1111

1212
```json
1313
{
14-
"name": "cf-sample-app-node",
14+
"name": "cf-sample-app-nodejs",
1515
"description": "A sample Node.js application to run on Cloud Foundry out of the box",
1616
"keywords": [
1717
"cloud-foundry"
@@ -37,10 +37,10 @@ The demo app you deployed already has a `package.json`, and it looks something l
3737
},
3838
"repository": {
3939
"type": "git",
40-
"url": "https://github.com/swisscom/cf-sample-app-node.git"
40+
"url": "https://github.com/swisscom/cf-sample-app-nodejs.git"
4141
},
4242
"bugs": {
43-
"url": "https://github.com/swisscom/cf-sample-app-node/issues"
43+
"url": "https://github.com/swisscom/cf-sample-app-nodejs/issues"
4444
}
4545
}
4646
```
@@ -51,7 +51,7 @@ Run this command in your local directory to install the dependencies, preparing
5151

5252
<pre class="terminal">
5353
$ npm install
54-
cf-sample-app-node@0.0.0 /.../cf-sample-app-node
54+
cf-sample-app-nodejs@0.0.0 /.../cf-sample-app-nodejs
5555
5656
│ ├── [email protected]
5757
│ ├── [email protected]

deploy.html.md.erb

+7-7
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ In this step you will deploy the app to <%= vars.product_full %>.
1010
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.
1111

1212
<pre class="terminal">
13-
$ cf push my-node-app -m 128M -n my-random-hostname
14-
Creating app my-node-app in org MyOrg / space MySpace as [email protected]...
13+
$ cf push my-nodejs-app -m 128M -n my-random-hostname
14+
Creating app my-nodejs-app in org MyOrg / space MySpace as [email protected]...
1515
OK
1616

1717
Creating route my-random-hostname.scapp.io...
1818
OK
1919

20-
Binding my-random-hostname.scapp.io to my-node-app...
20+
Binding my-random-hostname.scapp.io to my-nodejs-app...
2121
OK
2222

23-
Uploading my-node-app...
24-
Uploading app files from: /.../cf-sample-app-node
23+
Uploading my-nodejs-app...
24+
Uploading app files from: /.../cf-sample-app-nodejs
2525
Uploading 6.1K, 17 files
2626
Done uploading
2727
OK
@@ -40,8 +40,8 @@ buildpack: node.js 1.5.8
4040
The application is now deployed. Ensure that the app is running:
4141

4242
<pre class="terminal">
43-
$ cf app my-node-app
44-
Showing health and status for app my-node-app in org MyOrg / space MySpace as [email protected]...
43+
$ cf app my-nodejs-app
44+
Showing health and status for app my-nodejs-app in org MyOrg / space MySpace as [email protected]...
4545
OK
4646

4747
requested state: started

environment.html.md.erb

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ owner: Tobias Fuhrimann
1010
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.
1111

1212
<pre class="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]...
1515
OK
1616
TIP: Use 'cf restage' to ensure your env variable changes take effect
1717
</pre>
1818

1919
Then restage your app as suggested using
2020

2121
<pre class="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]...
2424
-----> Downloaded app package (8.0K)
2525
-----> Downloaded app buildpack cache (2.3M)
2626
-------> Buildpack version 1.5.8

index.html.md.erb

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ The tutorial assumes that you have an <a href="https://console.developer.swissco
1313

1414
Furthermore, you must have a first Cloud Foundry <a href="../concepts/roles.html#orgs" target="_blank">Organization</a> and <a href="../concepts/roles.html#spaces" target="_blank">Space</a> to push your apps to. In case you don't have that yet, please follow the <a href="https://console.developer.swisscom.com" target="_blank">tutorials in the web console</a> before returning here.
1515

16+
<p class="note">
17+
<strong>Note</strong>: In case you are stuck during the tutorial, you can always check out the <a href="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+
1620
<div style="text-align:center;margin:3em;">
1721
<a href="./set-up.html" class="btn btn-primary">I'm ready to start</a>
1822
</div>

logs.html.md.erb

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ owner: Tobias Fuhrimann
1010
View information about your running app using one of the logging commands, `cf logs`:
1111

1212
<pre class="terminal">
13-
$ cf logs my-node-app
14-
Connected, tailing logs for app my-node-app in org MyOrg / space MySpace as [email protected]...
13+
$ cf logs my-nodejs-app
14+
Connected, tailing logs for app my-nodejs-app in org MyOrg / space MySpace as [email protected]...
1515

1616
2016-03-30T16:37:06.39+0200 [App/0] OUT GET / 200 1.756 ms - 212
1717
2016-03-30T16:37:06.39+0200 [RTR/1] OUT my-random-hostname.scapp.io - [30/03/2016:14:37:06 +0000] "GET / HTTP/1.1" 200 0 212 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36" 195.65.130.2:61671 x_forwarded_for:"-" x_forwarded_proto:"http" vcap_request_id:f1ac25ce-2ca5-4538-59c5-83d58de55766 response_time:0.005294073 app_id:c98d5025-1bc9-46aa-8bba-51f55f7f2599
@@ -24,7 +24,7 @@ Press `Ctrl+C` to stop streaming the logs.
2424
You can use
2525

2626
<pre class="terminal">
27-
$ cf logs my-node-app --recent
27+
$ cf logs my-nodejs-app --recent
2828
</pre>
2929

3030
to get the most recent logs.

manifest.html.md.erb

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ It's tedious to keep having to specify the app name and other variables each tim
1010
```yaml
1111
---
1212
applications:
13-
- name: my-node-app
13+
- name: my-nodejs-app
1414
memory: 128MB
1515
instances: 1
1616

@@ -23,7 +23,7 @@ applications:
2323
NODE_ENV: production
2424
```
2525

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:
2727

2828
<pre class="terminal">
2929
$ cf push

prepare.html.md.erb

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ In this step, you will prepare a simple application that can be deployed.
99
Execute the following commands to clone the sample application:
1010

1111
<pre class="terminal">
12-
$ git clone https://github.com/swisscom/cf-sample-app-node.git
13-
$ cd cf-sample-app-node
12+
$ git clone https://github.com/swisscom/cf-sample-app-nodejs.git
13+
$ cd cf-sample-app-nodejs
1414
</pre>
1515

1616
You now have a functioning git repository that contains a simple <a href="https://expressjs.com/" target="_blank">Express</a> application as well as a `package.json` file, which is used by Node’s dependency manager npm.

push-changes.html.md.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Visiting your application at <a href="http://localhost:3000" target="_blank">htt
3434
Now deploy. All you need to do is `cf push` again:
3535

3636
<pre class="terminal">
37-
$ cf push my-node-app
37+
$ cf push my-nodejs-app
3838
</pre>
3939

4040
Finally, check that everything is working by visiting your app's URL from your web browser.

run-locally.html.md.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Now start your application locally using the `npm start` command:
1010
<pre class="terminal">
1111
$ npm start
1212

13-
&gt; cf-sample-app-node@0.0.0 start /.../cf-sample-app-node
13+
&gt; cf-sample-app-nodejs@0.0.0 start /.../cf-sample-app-nodejs
1414
&gt; node ./bin/www
1515
</pre>
1616

scale.html.md.erb

+7-7
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Currently, your app is running as a single instance with 128MB of memory.
1010
You can check how many instances are running and how much memory they have using the `cf scale` command:
1111

1212
<pre class="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]...
1515
OK
1616

1717
memory: 128M
@@ -26,8 +26,8 @@ By default, your app is deployed as one instance. Each instance runs in a separa
2626
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:
2727

2828
<pre class="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]...
3131
OK
3232
</pre>
3333

@@ -36,11 +36,11 @@ OK
3636
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:
3737

3838
<pre class="terminal">
39-
$ cf scale my-node-app -m 256M
39+
$ cf scale my-nodejs-app -m 256M
4040

41-
This will cause the app to restart. Are you sure you want to scale my-node-app?&gt; yes
41+
This will cause the app to restart. Are you sure you want to scale my-nodejs-app?&gt; yes
4242

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]...
4444
OK
4545

4646
...

0 commit comments

Comments
 (0)