은승우

Update app.js

Showing 1 changed file with 2 additions and 2 deletions
......@@ -84,7 +84,7 @@ async function handleEvent(event) {
return new Promise(async(resolve,reject)=>{
fs.writeFileSync('./photo/image.png',event.message.image)
var cheerio = require('cheerio');
var file=fs.readFileSync('./photo/image.png');
var uriBase = 'https://koreacentral.api.cognitive.microsoft.com/vision/v2.1/ocr';
var options = {
uri: uriBase,
......@@ -97,7 +97,7 @@ async function handleEvent(event) {
'Content-Type': 'application/octet-stream',
'Ocp-Apim-Subscription-Key': '979dc5d63344438fa4701c62feebb7dc'
},
body: fs.readFileSync('./photo/image.png')
body: file
};
request.post(options, function (error, response, body) {
......