은승우

Update app.js

Showing 1 changed file with 4 additions and 12 deletions
......@@ -85,19 +85,11 @@ async function handleEvent(event) {
client.getMessageContent(event.message.id)
.then((stream) => {
stream.on('data', (chunk) => {
console.log(chunk);
fs.writeFileSync('./photo/image.png', chunk, function (err) {
if (err) {
console.log('에러발생');
console.dir(err);
return;
}
});
var file=fs.readFileSync('./photo/image.png','application/json',function (err, data) {
//파일 다 읽었을 대 호출 됨
client.replyMessage(event.replyToken,chunk).then(resolve).catch(reject);
});
console.log(file);
var cheerio = require('cheerio');
var cheerio = require('cheerio');
var uriBase = 'https://koreacentral.api.cognitive.microsoft.com/vision/v2.1/ocr';
var options = {
......