김대욱

wish5

Showing 1 changed file with 3 additions and 14 deletions
......@@ -13,22 +13,11 @@ const sslport = 23023;
const bodyParser = require('body-parser');
var app = express();
app.use(bodyParser.json());
app.post('/hook', function (req, res) {
var eventObj = req.body.events[0];
var source = eventObj.source;
var cmd;
app.post('/hook', function (req, res) {
var message = eventObj.message;
// request log
console.log('======================', new Date() ,'======================');
console.log('[request]', req.body);
console.log('[request source] ', eventObj.source);
console.log('[request message]', eventObj.message);
var cmd = message.text;
console.log('[command]', cmd);
res.sendStatus(200);
cmd = message.text;
});
app.post('/hook', function (req, res) {
......