Showing
1 changed file
with
18 additions
and
1 deletions
... | @@ -6,6 +6,8 @@ const app = express(); | ... | @@ -6,6 +6,8 @@ const app = express(); |
6 | const PAPAGO_URL = 'https://openapi.naver.com/v1/papago/n2mt' | 6 | const PAPAGO_URL = 'https://openapi.naver.com/v1/papago/n2mt' |
7 | const PAPAGO_ID = 'cIZBOTfISMHEyygh_NHp'; | 7 | const PAPAGO_ID = 'cIZBOTfISMHEyygh_NHp'; |
8 | const PAPAGO_SECRET = '8D32UNGgYp'; | 8 | const PAPAGO_SECRET = '8D32UNGgYp'; |
9 | +const HTTPS = require('https'); | ||
10 | +const domain = "www.chatosscjh.tk" | ||
9 | const PORT = process.env.PORT || 3000; | 11 | const PORT = process.env.PORT || 3000; |
10 | 12 | ||
11 | //const indexRoute = require("./routes/index"); | 13 | //const indexRoute = require("./routes/index"); |
... | @@ -122,4 +124,19 @@ function trans(message, totrans){ | ... | @@ -122,4 +124,19 @@ function trans(message, totrans){ |
122 | return body.message.result.translatedText; | 124 | return body.message.result.translatedText; |
123 | } | 125 | } |
124 | }); | 126 | }); |
125 | -}; | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
127 | +}; | ||
128 | + | ||
129 | +try { | ||
130 | + const option = { | ||
131 | + ca: fs.readFileSync('/etc/letsencrypt/live/' + domain +'/fullchain.pem'), | ||
132 | + key: fs.readFileSync(path.resolve(process.cwd(), '/etc/letsencrypt/live/'$ | ||
133 | + cert: fs.readFileSync(path.resolve(process.cwd(), '/etc/letsencrypt/live/$ | ||
134 | + }; | ||
135 | + | ||
136 | + HTTPS.createServer(option, app).listen(sslport, () => { | ||
137 | + console.log(`[HTTPS] Server is started on port ${sslport}`); | ||
138 | + }); | ||
139 | + } catch (error) { | ||
140 | + console.log('[HTTPS] HTTPS 오류가 발생하였습니다. HTTPS 서버는 실행되지 않 $ | ||
141 | + console.log(error); | ||
142 | + } | ... | ... |
-
Please register or login to post a comment