Skip to content

Commit 1eadd17

Browse files
Jiaxin FanJiaxin Fan
authored andcommitted
Fix filepath in curl command
1 parent d4a2c4e commit 1eadd17

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

docs/users/standalone/README.md renamed to docs/standalone/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ Choose a NodeJS version. All build files reside inside `core/nodejsActionBase`.
2828
```
2929
FROM node:lts-stretch
3030
```
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.
3232

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

3535
What Gradle does is equivalent to running these commands
3636
```
@@ -84,7 +84,7 @@ The json file contains a simple JavaScript (the target runtime language) functio
8484
## Initialze the Runtime
8585
Before issuing the action against the runtime, we first initialize the function with by invoking the ```/init``` endpoint.
8686
```
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
8888
```
8989
the expected response being
9090
```
@@ -93,15 +93,15 @@ the expected response being
9393

9494
As mentioned above, if `port 80` on `localhost` was used, the command could simply be
9595
```
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
9797
```
9898

9999
## Run the function
100100

101101
Invoke the function using the ```/run``` endpoint.
102102

103103
```
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
105105
```
106106

107107
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
112112
```
113113
In this case the command to trigger the function should be
114114
```
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
116116
```
117117

118118
The expected response should be
@@ -153,12 +153,12 @@ These files shall be sent via the `init` API and via the `run` API respectively.
153153
To initialize the function, please make sure your NodeJS runtime container is running.
154154
First, issue a `POST` request against the `init` API using curl:
155155
```
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
157157
```
158158

159159
Next, trigger the function by issuing this request against the `run` API using curl:
160160
```
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
162162
```
163163

164164
You should expect the following client response:

0 commit comments

Comments
 (0)