Skip to content

Commit d731fbf

Browse files
committed
Update OpenWhisk documentation
1 parent 291f386 commit d731fbf

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

examples/openwhisk-example/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ You also need to update the paths inside `index.ts` and `package.json` to match
2626
You can see an example script to bundle the project with `ESBuild` in `build.js`.
2727
`yarn build` will build the artifacts of GraphQL Mesh first then bundle all the code needed for the OpenWhisk action by taking `index.ts` as an endpoint.
2828

29-
You can find the bundle in `dist/index.js` and deploy it either `yarn deploy` or manually with `wsk` like `wsk action update /guest/mesh/swapi --kind nodejs:16 dist/index.js`.
29+
You can find the bundle in `dist/index.js` and deploy it either `yarn deploy` or manually with `wsk` like `wsk action update /guest/mesh/swapi --kind nodejs:16 dist/index.js --web raw`.
30+
31+
> `--web raw` needs to be added to configure the action as a _raw_ web action.
3032

3133
## Running the project locally
3234

examples/openwhisk-example/src/index.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ import { createBuiltMeshHTTPHandler } from '../.mesh';
33
const httpHandler = createBuiltMeshHTTPHandler();
44

55
export const main = async function (params) {
6-
const response = await httpHandler.fetch(`http://localhost/api/v1/web/guest/mesh/swapi${params.__ow_path}`, {
7-
method: params.__ow_method,
8-
headers: params.__ow_headers,
9-
body: params.__ow_body ? Buffer.from(params.__ow_body, 'base64') : undefined,
10-
});
6+
const response = await httpHandler.fetch(
7+
`http://localhost/api/v1/web/guest/mesh/swapi${params.__ow_path}`,
8+
{
9+
method: params.__ow_method,
10+
headers: params.__ow_headers,
11+
body: params.__ow_body ? Buffer.from(params.__ow_body, 'base64') : undefined,
12+
},
13+
params
14+
);
1115

1216
const headers = {};
1317

0 commit comments

Comments
 (0)