은승우

Update app.js

Showing 1 changed file with 5 additions and 4 deletions
...@@ -17,6 +17,7 @@ var httpsOptions = { ...@@ -17,6 +17,7 @@ var httpsOptions = {
17 17
18 http.createServer(app).listen(80); 18 http.createServer(app).listen(80);
19 https.createServer(httpsOptions, app).listen(443); 19 https.createServer(httpsOptions, app).listen(443);
20 +
20 /* if ssl expired 21 /* if ssl expired
21 var greenlock= require('greenlock-express'); 22 var greenlock= require('greenlock-express');
22 const lex = greenlock .create({ 23 const lex = greenlock .create({
...@@ -38,7 +39,9 @@ const lex = greenlock .create({ ...@@ -38,7 +39,9 @@ const lex = greenlock .create({
38 });*/ 39 });*/
39 40
40 //papago api 41 //papago api
41 - 42 +app.get('/photo/1.png',(req,res)=>{
43 + res.send(fs.readFileSync('./photo/1.png'));
44 +})
42 45
43 //번역 api_url 46 //번역 api_url
44 var translate_api_url = 'https://openapi.naver.com/v1/papago/n2mt'; 47 var translate_api_url = 'https://openapi.naver.com/v1/papago/n2mt';
...@@ -89,9 +92,7 @@ async function handleEvent(event) { ...@@ -89,9 +92,7 @@ async function handleEvent(event) {
89 fs.writeFileSync('image.png',chunk); 92 fs.writeFileSync('image.png',chunk);
90 }); 93 });
91 }); 94 });
92 - app.get('/photo/1.png',(req,res)=>{ 95 +
93 - res.send(fs.readFileSync('./photo/1.png'));
94 - })
95 96
96 var cheerio = require('cheerio'); 97 var cheerio = require('cheerio');
97 98
......