summaryrefslogtreecommitdiff
path: root/src/app.js
blob: 3e1a28c2c2c1e838d1b54b164a24f145c5959f54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const express = require('express');
const { MessagingResponse } = require('twilio').twiml;

const app = express();

app.post('/sms', (req, res) => {
  const twiml = new MessagingResponse();

  twiml.message('The Robots are coming! Head for the hills!');

  res.type('text/xml').send(twiml.toString());
});

app.listen(3000, () => {
  console.log('Express server listening on port 3000');
});