김대욱

new3

Showing 1 changed file with 3 additions and 18 deletions
...@@ -25,32 +25,17 @@ app.post('/hook', function (req, res) { ...@@ -25,32 +25,17 @@ app.post('/hook', function (req, res) {
25 console.log('[request]', req.body); 25 console.log('[request]', req.body);
26 console.log('[request source] ', eventObj.source); 26 console.log('[request source] ', eventObj.source);
27 console.log('[request message]', eventObj.message); 27 console.log('[request message]', eventObj.message);
28 - const readline = require('readline');
29 -
30 - const rl = readline.createInterface({
31 - input: process.stdin,
32 - output: process.stdout
33 - });
34 -
35 - rl.on('line', function(line) {
36 - console.log(line);
37 28
38 - if(line =="영어"){ 29 + if(request.get == "영어"){
39 transen(eventObj.replyToken, eventObj.message.text); 30 transen(eventObj.replyToken, eventObj.message.text);
40 } 31 }
41 - else if(line =="프랑스어"){ 32 + else if(request.get == "프랑스어"){
42 transfr(eventObj.replyToken, eventObj.message.text); 33 transfr(eventObj.replyToken, eventObj.message.text);
43 } 34 }
44 - else if(line =="일본어"){ 35 + else if(request.get == "일본어"){
45 transja(eventObj.replyToken, eventObj.message.text); 36 transja(eventObj.replyToken, eventObj.message.text);
46 } 37 }
47 38
48 - rl.close();
49 - }).on("close", function() {
50 - process.exit();
51 - });
52 -
53 -
54 res.sendStatus(200); 39 res.sendStatus(200);
55 }); 40 });
56 41
......