Toggle navigation
Toggle navigation
This project
Loading...
Sign in
은승우
/
LINEBOT
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
은승우
2019-12-05 14:56:53 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6b44afd2398f75d0012ffa115c9389f930fa309b
6b44afd2
1 parent
7d0addbc
Update app.js
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
app.js
app.js
View file @
6b44afd
...
...
@@ -84,7 +84,7 @@ async function handleEvent(event) {
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
fs
.
writeFileSync
(
'./photo/image.png'
,
event
.
message
.
image
)
var
cheerio
=
require
(
'cheerio'
);
var
file
=
fs
.
readFileSync
(
'./photo/image.png'
);
var
uriBase
=
'https://koreacentral.api.cognitive.microsoft.com/vision/v2.1/ocr'
;
var
options
=
{
uri
:
uriBase
,
...
...
@@ -97,7 +97,7 @@ async function handleEvent(event) {
'Content-Type'
:
'application/octet-stream'
,
'Ocp-Apim-Subscription-Key'
:
'979dc5d63344438fa4701c62feebb7dc'
},
body
:
f
s
.
readFileSync
(
'./photo/image.png'
)
body
:
f
ile
};
request
.
post
(
options
,
function
(
error
,
response
,
body
)
{
...
...
Please
register
or
login
to post a comment