JavaScript client library for the OpenWhisk platform. Provides a wrapper around the OpenWhisk APIs.
$ npm install openwhisk // replace with package name....
var express = require('express') | |
var bodyParser = require('body-parser') | |
var app = express() | |
app.use(bodyParser.json()) | |
app.use(bodyParser.urlencoded()) | |
var requests = [] | |
var store_request = function (req) { | |
requests.push({ |
// This doesn't work.... | |
define("a/b/c", function () { | |
// return something.... | |
}); | |
var mod = require("a/b/c"); | |
// This does work... |
<html> | |
<script src="./lib/require.js"></script> | |
<script> | |
require.config({ | |
paths : { | |
//create alias to plugins (not needed if plugins are on the baseUrl) | |
async: 'src/async', | |
goog: 'src/goog', | |
propertyParser : 'src/propertyParser' | |
} |
// Register for custom events | |
document.addEventListener("oncustom", function () { | |
console.log("fired!"); | |
}); | |
// Createcustom DOM events and fire | |
var evt = document.createEvent("Event"); | |
evt.initEvent("oncustom", true, true); | |
document.dispatchEvent(evt) |
var fs = require('fs'), | |
jsdom = require("jsdom").jsdom, | |
document = jsdom("<html><head></head><body></body></html>"), | |
window = document.createWindow(); | |
// Fix window objects in global scope. | |
global.document = document; | |
global.navigator = window.navigator; | |
global.window = window; |
var profile = (function(){ | |
return { | |
layerOptimize: "closure", | |
releaseDir: "../../../release", | |
packages:[{ | |
name:"dojo", | |
location:"../../../dojo" | |
}], |
var vm = require('vm'); | |
var Debug = vm.runInDebugContext('Debug'); | |
Debug.setListener(function (event, exec_state) { | |
if (event !== Debug.DebugEvent.Break) return; | |
try { | |
console.log(exec_state.frame(0).evaluate('inner')) | |
} catch (err) { | |
console.log(err) | |
} |
JavaScript client library for the OpenWhisk platform. Provides a wrapper around the OpenWhisk APIs.
$ npm install openwhisk // replace with package name....
swagger: '2.0' | |
info: | |
version: 1.0.0 | |
title: hello_name | |
x-ibm-name: hello_name | |
host: $(catalog.host) | |
basePath: / | |
paths: | |
/hello_name: | |
get: |
<output id="output_2449884"> | |
<prompt selectionType="RANDOM"> | |
<item>Is there anything else I can help you with?</item> | |
</prompt> | |
<getUserInput> | |
<input> | |
<grammar> | |
<item>Yes</item> | |
</grammar> | |
</input> |