은승우

Update app.js

Showing 1 changed file with 3 additions and 11 deletions
...@@ -85,18 +85,10 @@ async function handleEvent(event) { ...@@ -85,18 +85,10 @@ async function handleEvent(event) {
85 client.getMessageContent(event.message.id) 85 client.getMessageContent(event.message.id)
86 .then((stream) => { 86 .then((stream) => {
87 stream.on('data', (chunk) => { 87 stream.on('data', (chunk) => {
88 - console.log(chunk); 88 + client.replyMessage(event.replyToken,chunk).then(resolve).catch(reject);
89 - fs.writeFileSync('./photo/image.png', chunk, function (err) { 89 +
90 - if (err) {
91 - console.log('에러발생');
92 - console.dir(err);
93 - return;
94 - }
95 - });
96 - var file=fs.readFileSync('./photo/image.png','application/json',function (err, data) {
97 - //파일 다 읽었을 대 호출 됨
98 }); 90 });
99 - console.log(file); 91 +
100 var cheerio = require('cheerio'); 92 var cheerio = require('cheerio');
101 93
102 var uriBase = 'https://koreacentral.api.cognitive.microsoft.com/vision/v2.1/ocr'; 94 var uriBase = 'https://koreacentral.api.cognitive.microsoft.com/vision/v2.1/ocr';
......