김대욱

오늘은 여기까지

Showing 1 changed file with 2 additions and 6 deletions
......@@ -14,12 +14,6 @@ const bodyParser = require('body-parser');
var app = express();
app.use(bodyParser.json());
app.get('/hook', function (req, res) {
var eventObj = req.body.events[0];
var message = eventObj.message;
var cmd = message.text;
});
app.post('/hook', function (req, res) {
var eventObj = req.body.events[0];
......@@ -32,6 +26,8 @@ app.post('/hook', function (req, res) {
console.log('[request source] ', eventObj.source);
console.log('[request message]', eventObj.message);
var cmd = message.text;
if(cmd == "영어"){
transen(eventObj.replyToken, eventObj.message.text);
}
......