- @nodebotanist
- technically a student (studying for BSE in EE @ Arizona State)
- Developer Relations Engineer @ Auth0/Webtask IO
- Gender Non-Binary (they/them)
- Why bother setting up an entire server just to run a webhook?
- Wanna customize slack without learning the entire API in a weekend?
- Want the ease of IFTTT but the power of Node.js?
- Run Node code without setting up a server
- Have as little or as much control as you need
- Supports 600+ npm modules
- Custom slack slash commands with just a few clicks
npm i -g wt-cli
wt init
more in the docs
module.exports = function(context, cb) {
cb(null, { hello: context.data.name || 'Anonymous' });
}
module.exports = function (context, req, res) {
res.writeHead(200, { 'Content-Type': 'text/html '});
res.end('<h1>Hello, world!</h1>');
}
module.exports = function(ctx. cb){
//common use: API keys for third-party services
service.connect(ctx.secrets.myAPIKey);
}
wt create webtask.js --secret myAPIKey=doTHOhdeou8dhotedundh
var app = new (require('express'))();
app.get('/', (req, res) => res.send('Hello World'));
module.exports = app;
- Write your webtask, using
ctx.query
if it will take GET requests andctx.body
if the webhook will take POST requests - You'll get a URL when you deploy your webtask
- point the service at that URL
- Add the webtask app to your slack org
- run
/wt create [name]
in any channel - you'll be pointed to the webtask editor to vrite your new commands
Open live-streaming logs using wt logs
for the cli, they appear in the bottom pane of the web editor
- @nodebotanist on Twitter, github, MLH slack
- [email protected]