openwhisk-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Thomas <jthomas...@gmail.com>
Subject Apache OpenWhisk Web Action HTTP Proxy
Date Tue, 30 Apr 2019 09:36:50 GMT
Hello Whiskers.

I wanted to share an experiment I built recently to run existing web apps
on openwhisk (with minimal changes) using custom Docker images support.

https://github.com/jthomas/openwhisk-web-action-http-proxy

It uses a HTTP proxy binary inside the runtime container to proxy incoming
Web Action requests to the web apps run on a different port inside the same
container. HTTP responses are returned to the platform as Web Action
responses.

For simple & stateless web apps - it worked better than I thought. Here's
an example of how to use this with an exsting Node.js+Express Web App:

https://github.com/jthomas/openwhisk-web-action-http-proxy#nodejs--express-example

$ git clone https://github.com/jthomas/express_example
$ cd express_example & npm install
$ zip -r action.zip *
$ wsk action create --docker jamesthomas/generic_node_proxy --web true
--main "npm start" -p "__ow_proxy_port" 3000 web_app action.zip
$ wsk action get web_app --url

Two different options are available for getting web application source
files into the runtime environment - runtime injection using zip files or
putting source files directly into the runtime image.

There's lots more details about the project in the project README and I've
now written a blog post in more details about the project here:

http://jamesthom.as/blog/2019/04/29/apache-openwhisk-web-action-http-proxy/

-- 
Regards,
James Thomas

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message