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
Copy file name to clipboardExpand all lines: docs/standalone/README.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,9 +28,9 @@ Choose a NodeJS version. All build files reside inside `core/nodejsActionBase`.
28
28
```
29
29
FROM node:lts-stretch
30
30
```
31
-
This will use the latest NodeJS version. But we want to be more specific. Now if you look into each of the Dockerfile within `core/nodejs14Action`, `core/nodejs16Action`, `core/nodejs18Action`, you’ll notice different NodeJS versions. Let’s go ahead with the 18 version. We are going to use this version throughout the README, for the others, you merely have to modify the version number.
31
+
This will use the latest NodeJS version. But we want to be more specific. Now if you look into each of the Dockerfile within `core/nodejs14Action`, `core/nodejs16Action`, `core/nodejs18Action`, you’ll notice different NodeJS versions. Let’s go ahead with the 18 version, we are going to use this throughout this README. For the other versions, you merely have to modify the version number.
32
32
33
-
Gradle will a create `build` folder that will contain all the necessary files to build our NodeJS container. Next, it will copy the NodeJS application (server used to implement the [action interface](https://github.com/apache/openwhisk/blob/master/docs/actions-new.md#action-interface)) as well as the target Dockerfile with the NodeJS version 18.
33
+
Gradle will a create `build` folder that will contain all the necessary files to build our NodeJS container. Next, it will copy the NodeJS application (server used to implement the [action interface](https://github.com/apache/openwhisk/blob/master/docs/actions-new.md#action-interface)) as well as the target Dockerfile with the NodeJS version 18.
34
34
35
35
What Gradle does is equivalent to running these commands
36
36
```
@@ -84,7 +84,7 @@ The json file contains a simple JavaScript (the target runtime language) functio
84
84
## Initialze the Runtime
85
85
Before issuing the action against the runtime, we first initialize the function with by invoking the ```/init``` endpoint.
86
86
```
87
-
curl -H "Content-Type:application/json" -X POST --data '@/$FILEPATH/js-init.json' http://localhost:3008/init
87
+
curl -H "Content-Type:application/json" -X POST --data '@/docs/users/standalone/helloworld/js-init.json' http://localhost:3008/init
88
88
```
89
89
the expected response being
90
90
```
@@ -93,15 +93,15 @@ the expected response being
93
93
94
94
As mentioned above, if `port 80` on `localhost` was used, the command could simply be
95
95
```
96
-
curl -H "Content-Type:application/json" -X POST --data '@/$FILEPATH/js-init.json' http://localhost/init
96
+
curl -H "Content-Type:application/json" -X POST --data '@/docs/users/standalone/helloworld/js-init.json' http://localhost/init
97
97
```
98
98
99
99
## Run the function
100
100
101
101
Invoke the function using the ```/run``` endpoint.
102
102
103
103
```
104
-
curl -H ""Content-Type:application/json" -X POST --data '@/$FILEPATH/js-init.json' http://localhost:3008/run
104
+
curl -H ""Content-Type:application/json" -X POST --data '@//docs/users/standalone/helloworld/js-init.json' http://localhost:3008/run
105
105
```
106
106
107
107
The JavaScript function in this example is one without arguments (nullary function). Using the same json file as during initialization won't be a problem. Ideally, we should have provided another file `js-params.json` with the arguments to trigger the function.
@@ -112,7 +112,7 @@ The JavaScript function in this example is one without arguments (nullary functi
112
112
```
113
113
In this case the command to trigger the function should be
114
114
```
115
-
curl -H ""Content-Type:application/json" -X POST --data '/$FILEPATH/js-params.json' http://localhost:3008/run
115
+
curl -H ""Content-Type:application/json" -X POST --data '@/docs/users/standalone/helloworld/js-params.json' http://localhost:3008/run
116
116
```
117
117
118
118
The expected response should be
@@ -153,12 +153,12 @@ These files shall be sent via the `init` API and via the `run` API respectively.
153
153
To initialize the function, please make sure your NodeJS runtime container is running.
154
154
First, issue a `POST` request against the `init` API using curl:
155
155
```
156
-
curl -H "Content-Type:application/json" -X POST --data '@/$FILEPATH/js-init-params.json' http://localhost:3008/init
156
+
curl -H "Content-Type:application/json" -X POST --data '@/docs/users/standalone/helloworldwithparams/js-init-params.json' http://localhost:3008/init
157
157
```
158
158
159
159
Next, trigger the function by issuing this request against the `run` API using curl:
160
160
```
161
-
curl -H ""Content-Type:application/json" -X POST --data '/$FILEPATH/js-run-params.json' http://localhost:3008/run
161
+
curl -H ""Content-Type:application/json" -X POST --data '@/docs/users/standalone/helloworldwithparams/js-run-params.json' http://localhost:3008/run
0 commit comments