This is an automated email from the ASF dual-hosted git repository.

bdelacretaz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git


The following commit(s) were added to refs/heads/master by this push:
     new b04ef2f  Comment OpenWhisk actions
b04ef2f is described below

commit b04ef2fff70617cb0806addfb2feb8f90ae9a70d
Author: Bertrand Delacretaz <[email protected]>
AuthorDate: Tue Jul 30 13:03:59 2019 +0200

    Comment OpenWhisk actions
---
 serverless-microsling/lib/openwhisk-renderer.js | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/serverless-microsling/lib/openwhisk-renderer.js 
b/serverless-microsling/lib/openwhisk-renderer.js
index d703607..711817e 100644
--- a/serverless-microsling/lib/openwhisk-renderer.js
+++ b/serverless-microsling/lib/openwhisk-renderer.js
@@ -16,7 +16,11 @@
 
  /* eslint-disable no-console */
 
- const openwhisk = require('openwhisk');
+/** Proxy renderer which uses an OpenWhisk action for
+ *  rendering, if one matches the current request's
+ *  resource type and extension.
+ */
+const openwhisk = require('openwhisk');
 
 const getAnnotation = (act, key) => {
   if(act != null) {
@@ -25,6 +29,13 @@ const getAnnotation = (act, key) => {
   }
 }
 
+// If an action matches the specified resource type (*)
+// and extension (*), return its info and the content-type
+// that it provides (*).
+// Items marked with (*) are defined by OpenWhisk annotations
+// on the actions.
+// A "sling:resourceType" annotation with value "*" matches all
+// resource types.
 const getActionInfo = async (resourceType, extension) => {
   return new Promise(resolve => {
     var ow = openwhisk();

Reply via email to