은승우

Update app.js

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