Showing
1 changed file
with
5 additions
and
2 deletions
1 | var express = require("express"); | 1 | var express = require("express"); |
2 | var app = express(); | 2 | var app = express(); |
3 | +var cheerio = require('cheerio'); | ||
3 | const line = require('@line/bot-sdk'); | 4 | const line = require('@line/bot-sdk'); |
4 | var request = require('request'); | 5 | var request = require('request'); |
5 | var https=require('https'); | 6 | var https=require('https'); |
... | @@ -181,7 +182,6 @@ function handleEvent(event) { | ... | @@ -181,7 +182,6 @@ function handleEvent(event) { |
181 | } | 182 | } |
182 | else if (event.message.text.indexOf('http')!=-1) { | 183 | else if (event.message.text.indexOf('http')!=-1) { |
183 | return new Promise(async(resolve,reject)=>{ | 184 | return new Promise(async(resolve,reject)=>{ |
184 | - var cheerio = require('cheerio'); | ||
185 | var uriBase = 'https://koreacentral.api.cognitive.microsoft.com/vision/v2.1/ocr'; | 185 | var uriBase = 'https://koreacentral.api.cognitive.microsoft.com/vision/v2.1/ocr'; |
186 | var imageUrl=event.message.text; | 186 | var imageUrl=event.message.text; |
187 | var options = { | 187 | var options = { |
... | @@ -237,6 +237,7 @@ function handleEvent(event) { | ... | @@ -237,6 +237,7 @@ function handleEvent(event) { |
237 | }); | 237 | }); |
238 | }); | 238 | }); |
239 | } | 239 | } |
240 | + else{ | ||
240 | return new Promise(function(resolve, reject) { | 241 | return new Promise(function(resolve, reject) { |
241 | //언어 감지 option | 242 | //언어 감지 option |
242 | var detect_options = { | 243 | var detect_options = { |
... | @@ -298,6 +299,8 @@ function handleEvent(event) { | ... | @@ -298,6 +299,8 @@ function handleEvent(event) { |
298 | }); | 299 | }); |
299 | }); | 300 | }); |
300 | } | 301 | } |
302 | +} | ||
303 | + | ||
301 | app.get('/',(req,res)=>{ | 304 | app.get('/',(req,res)=>{ |
302 | - res.send("hellow"); | 305 | + res.send("hello"); |
303 | }) | 306 | }) |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment