Add triggerFlow to the exported interface of the library.
Usage:
const { Flow, Reply, triggerFlow } = require('./twilly');
const app = require('express')();
// App setup...
// Example request, accepts a POST request with a JSON body with a single field:
// "toNumber", a string field with the phone number you wish to send a message
// to.
app.post('/message', (req, res) => {
const toNumber = req.body.toNumber;
triggerFlow(
toNumber,
new Flow('messageUser').addAction('reply', new Reply('Hello world!')),
);
res.status(200).end();
});
// Rest of app...
Add
triggerFlow
to the exported interface of the library.Usage:
Also I got a head start on #6.
Still needs unit tests before ready for release