sciabarracom opened a new issue, #71:
URL: https://github.com/apache/openserverless/issues/71

   Currently the go proxy for runtines does not answer in port 8080 at the root 
level (the answer is empty). It answer to /run and returns a json. 
   
   The output for webactions is defined by [this 
spec](https://github.com/apache/openwhisk/blob/master/docs/webactions.md)
   
   In order to improve testability and also support knative using our runtimes, 
we should implement input and interpret the outout of a web action direclty in 
the proxy.
   
   So if we invoke the proxy at the root: (`http://localhost:8080/`) it should 
work like `/run` but we should pass the parameters `__ow_*` as defined in the 
spec and then intepret the output according the webactions spec. For example if 
an action returns:
   
   ```
   { 
     "body": "<h1>hello</h1>"
   }
   ```
   
   it should NOT return the json but actually `<h1>hello</h1>`, with an 
appropriate content type (default `text/html`).
   
   
   We should also implement the other fields. For example invoking 
http://localhost:8080/ for this aswer
   
   ```
   { 
     "statusCode": 307,
     "headers": { "Location": "https://www.google.com"; } 
   } 
   ```
   
   will return an empty body with status coden 307 and the header Location to 
implement a redirect.
   
   
   Finally we should support images:
   
   the answer:
   
   
   ```
    { 'Content-Type': 'image/png' },
       statusCode: 200,
       body: "xxxxx" 
   }
   ```
   
   when the content type starts with `image/` should decode the body as base64 
encoded.
   
   OpenWhisk also allow for setting the content tye extensions, so we should 
add the ability to use `/index.html` to returnthe body with default 
content-type `text/html`, while `index.json` will use `content-type: 
application/json`, `index.txt` returns `text/plain`, `index.png` and 
`index.jpg` returns `image/png` and `image/jpeg`. 
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@openserverless.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to