은승우

Update app.js

Showing 1 changed file with 3 additions and 1 deletions
......@@ -86,6 +86,7 @@ async function handleEvent(event) {
.then((stream) => {
stream.on('data', (chunk) => {
console.log(chunk);
var cheerio = require('cheerio');
var uriBase = 'https://koreacentral.api.cognitive.microsoft.com/vision/v2.1/ocr';
......@@ -105,7 +106,8 @@ async function handleEvent(event) {
request.post(options, function (error, response, body) {
console.log(options);
var data=atob(body);
var data= Buffer.from(body, 'base64').toString();
var text='';
console.log(data);
while(data.indexOf('text\\')!=-1)
......