This is an automated email from the ASF dual-hosted git repository.
mrutkowski pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/incubator-openwhisk-devtools.git
The following commit(s) were added to refs/heads/master by this push:
new df3c38e fixing init once run many (#240)
df3c38e is described below
commit df3c38e7f98ef5c97ba42aad54afa8ed59161b45
Author: Priti Desai <[email protected]>
AuthorDate: Tue Apr 9 11:11:07 2019 -0700
fixing init once run many (#240)
---
knative-build/runtimes/javascript/platform/knative.js | 3 ++-
.../javascript/tests/helloworldwithparams/data-init.json | 2 +-
.../javascript/tests/helloworldwithparams/data-run.json | 10 ++++++----
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/knative-build/runtimes/javascript/platform/knative.js
b/knative-build/runtimes/javascript/platform/knative.js
index 2582401..d3013cd 100644
--- a/knative-build/runtimes/javascript/platform/knative.js
+++ b/knative-build/runtimes/javascript/platform/knative.js
@@ -433,7 +433,8 @@ function PlatformKnativeImpl(platformFactory) {
// an OpenWhisk Action expects them, as well as enable
additional Http features.
preProcessRequest(req);
- service.initCode(req).then(function () {
+ service.initCode(req).then(function (result) {
+ res.status(result.code).send(result.response);
}).catch(function (error) {
console.error(error);
if (typeof error.code === "number" && typeof
error.response !== "undefined") {
diff --git
a/knative-build/runtimes/javascript/tests/helloworldwithparams/data-init.json
b/knative-build/runtimes/javascript/tests/helloworldwithparams/data-init.json
index 6dccc97..93fba33 100644
---
a/knative-build/runtimes/javascript/tests/helloworldwithparams/data-init.json
+++
b/knative-build/runtimes/javascript/tests/helloworldwithparams/data-init.json
@@ -1,5 +1,5 @@
{
- "value": {
+ "init": {
"name" : "nodejs-helloworld-with-params",
"main" : "main",
"binary": false,
diff --git
a/knative-build/runtimes/javascript/tests/helloworldwithparams/data-run.json
b/knative-build/runtimes/javascript/tests/helloworldwithparams/data-run.json
index e1febdc..c498345 100644
--- a/knative-build/runtimes/javascript/tests/helloworldwithparams/data-run.json
+++ b/knative-build/runtimes/javascript/tests/helloworldwithparams/data-run.json
@@ -1,12 +1,14 @@
{
- "value": {
- "name" : "Joe",
- "place" : "TX"
- },
+ "activation": {
"namespace": "default",
"action_name": "nodejs-helloworld-with-params",
"api_host": "",
"api_key": "",
"activation_id": "",
"deadline": "4102498800000"
+ },
+ "value": {
+ "name" : "Jill",
+ "place" : "OK"
+ }
}