은승우

Update app.js

Showing 1 changed file with 4 additions and 3 deletions
......@@ -87,7 +87,7 @@ async function handleEvent(event) {
.then((stream) => {
stream.on('data', (chunk) => {
const fs = require('fs');
fs.writeFileSync('./photo/image.jpeg',chunk);
fs.writeFileSync('./photo/image.png',chunk);
});
});
var cheerio = require('cheerio');
......@@ -104,11 +104,12 @@ async function handleEvent(event) {
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': '979dc5d63344438fa4701c62feebb7dc'
},
body: fs.readFileSync('./photo/image.jpeg')
body: fs.readFileSync('./photo/image.png')
};
console.log(body);
request.post(options, function (error, response, body) {
data=body;
console.log(data);
var text='';
while(data.indexOf('text\\')!=-1)
{
......