webtask-require
Use webtask-require
to call your webtasks from the browser. Run node.js code without a backend.
var wt = '<your-webtask-container>';;
Call a Webtask
Create a webtask
$ npm install -g wt-cli$ wt init$ echo "module.exports = function (cb) {cb(null, 'Hello');}" > hello.js$ wt create hello.js
Call it from JavaScript
var wt = '<your-webtask-container>';;
Sending Parameters
var wt = '<your-webtask-container>';;
Specify HTTP Method
wt;wt;wt;wr;wt;
Secure Webtasks
Create the webtask protected with Auth0 using JSON Web Tokens
$ echo "module.exports = function (cb) {cb(null, 'Hello');}" > hello.js$ wt create hello.js --auth0 --clientId=<your-clientid> --clientSecret=<your-clientsecret> --auth0Domain=<yours.auth0.com>
Call it
var lock = '<your-clientid>' '<yours.auth0.com>';var wt = '<your-webtask-container>'; lock;