김대욱

a

Showing 1 changed file with 4 additions and 0 deletions
......@@ -13,6 +13,7 @@ const sslport = 23023;
const bodyParser = require('body-parser');
var app = express();
app.use(bodyParser.json());
/*
var cmd = "";
app.post('/hook', function (req, res) {
......@@ -30,6 +31,7 @@ app.post('/hook', function (req, res) {
res.sendStatus(200);
});
*/
app.post('/hook', function (req, res) {
var eventObj = req.body.events[0];
......@@ -42,6 +44,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 == "영어"){
trans(eventObj.replyToken, eventObj.message.text);
}
......