권은령

Update app.js

Showing 1 changed file with 6 additions and 10 deletions
...@@ -29,7 +29,7 @@ const lex = greenlock .create({ ...@@ -29,7 +29,7 @@ const lex = greenlock .create({
29 opts.agreeTos = true; 29 opts.agreeTos = true;
30 } 30 }
31 cb(null, { options: opts, certs }); 31 cb(null, { options: opts, certs });
32 - 32 +
33 }, 33 },
34 renewWithin: 81 * 24 * 60 * 60 * 1000, 34 renewWithin: 81 * 24 * 60 * 60 * 1000,
35 renewBy: 80 * 24 * 60 * 60 * 1000, 35 renewBy: 80 * 24 * 60 * 60 * 1000,
...@@ -63,24 +63,23 @@ const client = new line.Client(config); ...@@ -63,24 +63,23 @@ const client = new line.Client(config);
63 // about the middleware, please refer to doc 63 // about the middleware, please refer to doc
64 64
65 // Creates a client 65 // Creates a client
66 +/* google-api
66 var vision = require('google-vision-api-client'); 67 var vision = require('google-vision-api-client');
67 68
68 var requtil = vision.requtil; 69 var requtil = vision.requtil;
69 70
70 - 71 +
71 72
72 //Prepare your service account from trust preview certificated project 73 //Prepare your service account from trust preview certificated project
73 74
74 var jsonfile = '/home/ubuntu/a/LINEBOT/googlevisionapikey.json'; 75 var jsonfile = '/home/ubuntu/a/LINEBOT/googlevisionapikey.json';
75 76
76 - 77 +
77 78
78 //Initialize the api 79 //Initialize the api
79 80
80 vision.init(jsonfile); 81 vision.init(jsonfile);
81 82
82 -
83 -
84 //Build the request payloads 83 //Build the request payloads
85 var d = requtil.createRequests().addRequest( 84 var d = requtil.createRequests().addRequest(
86 requtil.createRequest('/home/ubuntu/a/LINEBOT/photo/Fancy-TWICE.jpg') 85 requtil.createRequest('/home/ubuntu/a/LINEBOT/photo/Fancy-TWICE.jpg')
...@@ -92,9 +91,7 @@ if(e) console.log('ERROR:', e); ...@@ -92,9 +91,7 @@ if(e) console.log('ERROR:', e);
92 console.log(JSON.stringify(d)); 91 console.log(JSON.stringify(d));
93 }); 92 });
94 93
95 - 94 +*/
96 -
97 -
98 95
99 96
100 app.post('/webhook', line.middleware(config), (req, res) => { 97 app.post('/webhook', line.middleware(config), (req, res) => {
...@@ -142,7 +139,7 @@ function handleEvent(event) { ...@@ -142,7 +139,7 @@ function handleEvent(event) {
142 headers: {'X-Naver-Client-Id': client_id, 'X-Naver-Client-Secret': client_secret} 139 headers: {'X-Naver-Client-Id': client_id, 'X-Naver-Client-Secret': client_secret}
143 140
144 }; 141 };
145 - 142 +
146 // Naver Post API 143 // Naver Post API
147 console.log("?!"); 144 console.log("?!");
148 request.post(options, function(error, response, body){ 145 request.post(options, function(error, response, body){
...@@ -175,4 +172,3 @@ function handleEvent(event) { ...@@ -175,4 +172,3 @@ function handleEvent(event) {
175 172
176 }); 173 });
177 } 174 }
178 -
......