Command line tool for using webtasks to create microservices in seconds.
$ npm i -g wt-cli
$ wt init
Write webtask code to the hello-world.js file:
module.exports = function (cb) {
cb(null, 'Hello webtasks!');
}
wt create hello-world.js
and call it...
curl https://webtask.it.auth0.com/api/run/{yours}/hello-world
wt create https://raw.githubusercontent.com/auth0/wt-cli/master/sample-webtasks/html-response.js \
--name html-response-url
wt create https://raw.githubusercontent.com/auth0/wt-cli/master/sample-webtasks/mongodb.js \
--name mongo \
--secret MONGO_URL=mongodb://webtask:supersecret@ds047592.mongolab.com:47592/webtask-examples
This is a real mongodb URL (powered by mongolab), no guarrantee that it will work :)
wt create https://raw.githubusercontent.com/auth0/wt-cli/master/sample-webtasks/express.js \
--name express \
--no-parse --no-merge
wt logs
wt cron schedule -n mongocron \
-s MONGO_URL=mongodb://webtask:supersecret@ds047592.mongolab.com:47592/webtask-examples \
"*/10 * * * *" \
https://raw.githubusercontent.com/auth0/wt-cli/master/sample-webtasks/mongodb.js
This cron will insert a document in a mongo collection every 10 minutes
wt cron history mongogron
wt cron ls
If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.
This project is licensed under the MIT license. See the LICENSE file for more info.