은승우

Update app.js

Showing 1 changed file with 2 additions and 6 deletions
......@@ -87,12 +87,8 @@ async function handleEvent(event) {
.then((stream) => {
stream.on('data', (chunk) => {
const fs = require('fs');
const file = fs.createWriteStream('./photo/image.jpeg');
for(let i=0; i<= 1e6; i++) {
file.write(chunk);
}
file.end();
});
const file = fs.writeFileSync('./photo/image.jpeg',chunk);
});
var cheerio = require('cheerio');
......