@jajoosam/

wikibot-start

Express

Start Building WikiBot!

fork
loading
Files
  • index.js
  • views
  • package-lock.json
  • package.json

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.1936574814155163","path":"index.js","file":{"path":"index.js","content":{"asEncoding":{"base64":"dmFyIGV4cHJlc3MgPSByZXF1aXJlKCdleHByZXNzJyk7CnZhciBhcHAgPSBleHByZXNzKCk7CnZhciByZXF1ZXN0ID0gcmVxdWlyZSgncmVxdWVzdCcpOwpjb25zdCBib2R5UGFyc2VyID0gcmVxdWlyZSgnYm9keS1wYXJzZXInKTsKCgpjb25zdCBhY2NvdW50U2lkID0gcHJvY2Vzcy5lbnYuU0lEOwpjb25zdCBhdXRoVG9rZW4gPSBwcm9jZXNzLmVudi5LRVk7Cgpjb25zdCBjbGllbnQgPSByZXF1aXJlKCd0d2lsaW8nKShhY2NvdW50U2lkLCBhdXRoVG9rZW4pOwpjb25zdCBNZXNzYWdpbmdSZXNwb25zZSA9IHJlcXVpcmUoJ3R3aWxpbycpLnR3aW1sLk1lc3NhZ2luZ1Jlc3BvbnNlOwoKYXBwLnVzZShleHByZXNzLnN0YXRpYygncHVibGljJykpOwphcHAudXNlKGJvZHlQYXJzZXIudXJsZW5jb2RlZCh7IGV4dGVuZGVkOiBmYWxzZSB9KSk7CgoKYXBwLnBvc3QoJy9pbmNvbWluZycsIChyZXEsIHJlcykgPT4gewogIGNvbnNvbGUubG9nKHJlcS5ib2R5KQp9KTsKCmFwcC5nZXQoJy8nLCBmdW5jdGlvbihyZXF1ZXN0LCByZXNwb25zZSkgewogIHJlc3BvbnNlLnNlbmRGaWxlKF9fZGlybmFtZSArICcvdmlld3MvaW5kZXguaHRtbCcpOwp9KTsKCgp2YXIgbGlzdGVuZXIgPSBhcHAubGlzdGVuKHByb2Nlc3MuZW52LlBPUlQsIGZ1bmN0aW9uKCkgewogIGNvbnNvbGUubG9nKCdZb3VyIGFwcCBpcyBsaXN0ZW5pbmcgb24gcG9ydCAnICsgbGlzdGVuZXIuYWRkcmVzcygpLnBvcnQpOwp9KTsKCg=="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var express = require('express');
var app = express();
var request = require('request');
const bodyParser = require('body-parser');


const accountSid = process.env.SID;
const authToken = process.env.KEY;

const client = require('twilio')(accountSid, authToken);
const MessagingResponse = require('twilio').twiml.MessagingResponse;

app.use(express.static('public'));
app.use(bodyParser.urlencoded({ extended: false }));


app.post('/incoming', (req, res) => {
  console.log(req.body)
});

app.get('/', function(request, response) {
  response.sendFile(__dirname + '/views/index.html');
});


var listener = app.listen(process.env.PORT, function() {
  console.log('Your app is listening on port ' + listener.address().port);
});