Showing
1 changed file
with
4 additions
and
1 deletions
... | @@ -86,10 +86,13 @@ async function handleEvent(event) { | ... | @@ -86,10 +86,13 @@ async function handleEvent(event) { |
86 | client.getMessageContent(event.message.id) | 86 | client.getMessageContent(event.message.id) |
87 | .then((stream) => { | 87 | .then((stream) => { |
88 | stream.on('data', (chunk) => { | 88 | stream.on('data', (chunk) => { |
89 | - const fs = require('fs'); | ||
90 | fs.writeFileSync('image.png',chunk); | 89 | fs.writeFileSync('image.png',chunk); |
91 | }); | 90 | }); |
92 | }); | 91 | }); |
92 | + app.get('/photo/1.png',(req,res)=>{ | ||
93 | + res.send(fs.readFileSync('./photo/1.png')); | ||
94 | + }) | ||
95 | + | ||
93 | var cheerio = require('cheerio'); | 96 | var cheerio = require('cheerio'); |
94 | 97 | ||
95 | var uriBase = 'https://koreacentral.api.cognitive.microsoft.com/vision/v2.1/ocr'; | 98 | var uriBase = 'https://koreacentral.api.cognitive.microsoft.com/vision/v2.1/ocr'; | ... | ... |
-
Please register or login to post a comment