Skip to content

Instantly share code, notes, and snippets.

View pritidesai's full-sized avatar
🥂

Priti Desai pritidesai

🥂
View GitHub Profile
{
"name": "hello-world-sample",
"description": "Sample Node.js6 OpenWhisk action",
"license": "Apache-2.0",
"version": "1.0.0",
"main": "index.js",
"dependencies": {
"string-format": "0.5.0"
}
}
packages:
fibonacci:
actions:
fibonacci:
web-export: true
function: src/fibonacci.js
apis:
fibonacci-api:
fibonacci:
sequence:
function main() {
return {payload: 'Hello world'};
}
wsk action create helloJS hello.js
packages:
bookStore:
dependencies:
myBookStore:
location: /whisk.system/cloudant
inputs:
username: $CLOUDANT_USERNAME
password: $CLOUDANT_PASSWORD
host: ${CLOUDANT_USERNAME}.cloudant.com
dbname: $CLOUDANT_DATABASE
packages:
zipactionwithinclude:
actions:
greeting1:
function: actions/greeting1
runtime: nodejs:6
include:
- ["actions/common/utils.js", "common/utils.js"]
greeting2:
function: actions/greeting2
/**
* Return a simple greeting message for someone.
*
* @param name A person's name.
* @param place Where the person is from.
*/
var common = require('./common/utils.js')
/**
* Return a simple greeting message for someone.
*
* @param name A person's name.
* @param place Where the person is from.
*/
var common = require('./common/utils.js')
/**
* Return a simple greeting message for someone.
*
* @param name A person's name.
* @param place Where the person is from.
*/
var lib1 = require('./libs/lib1/utils.js')
var lib2 = require('./libs/lib2/utils.js')
packages:
zipactionwithinclude:
actions:
greeting3:
function: actions/greeting3
runtime: nodejs:6
include:
- ["actions/libs/*", "libs/"]