This repo is an experiment with the main purpose of learning React & Redux. Because I played around with Apache OpenWhisk earlier, I decided to create a UI for this FaaS platform.
With this UI, you will be able to create actions, triggers and rules. This UI can be useful when working with custom cloud deployments of OpenWhisk.
- React
- Redux
- Webpack
Other libraries:
- axios
- lodash
- react-ace
- react-pagination
- redux-logger
- redux-promise
- redux-thunk
For testing:
- jest
- enzyme
- sinon
- deep-freeze
You have 2 options here:
- Deploy a custom OpenWhisk in your cloud infrastructure
- Use a hosted version of OpenWhisk on Bluemix:
- create an account on Bluemix OpenWhisk,
- download, install and configure Bluemix CLI
- install and enable
Allow-Control-Allow-Origin: *
add-on in Chrome Browser
Remember about disabling the CORS add-on after you're finished playing around.
-
After
Bluemix CLI
is installed, runbx wsk property get
-
Encode
whisk auth
token, consisting of username and password (username:password):echo -n username:password | base64
-
Copy
whisk API host
,whisk API version
, returnedtoken
from command above and paste intoconfig.js
file:export const config = { baseUrl: 'https://<whisk API host>/api/<whisk API version>/namespaces/<your email>_dev', namespace: '<your email>_dev', token: 'Basic <token>' };
-
Install all dependencies
yarn install
-
Run
npm start
The application should appear under localhost (port 8080 is set by default).
And VoilĂ ! Have fun!
- Create an action with this code and name it as you want:
function main(params) {
return {
result: 'Hello ' + params.name
};
}
- Create a trigger with these parameters:
[
{
"key": "name",
"value": "WRITE_HERE_YOUR_NAME"
}
]
- Create a rule to connect your action and trigger.
- Go to Trigger list and Run your trigger.
- Go to Activations list and display details. You should see something like this:
{
"response": {
"result": {
"result": "Hello WRITE_HERE_YOUR_NAME"
},
"success": true,
"status": "success"
},
"logs": []
}
In case if you don't see new activation, just wait. When you run a trigger, OpenWhisk has to take its parameters, inject them into the action and then create an activation. It can take a while.
There are a couple of things, which will be improved:
- RWD (the application was tested only on Chrome browser and 15-inch laptop)
- modals (confirmation before deleting and information in case of any failures)
- listening for the new activations
- caching
- add possibility to run the code using a custom image (blackbox option)
- create sequence actions (with drag and drop)