장주현

github 배포용으로 수정

Showing 1 changed file with 23 additions and 19 deletions
...@@ -4,11 +4,11 @@ const fs = require('fs'); ...@@ -4,11 +4,11 @@ const fs = require('fs');
4 const bodyParser = require('body-parser'); 4 const bodyParser = require('body-parser');
5 const app = express(); 5 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 = 'Client ID';
8 -const PAPAGO_SECRET = '8D32UNGgYp'; 8 +const PAPAGO_SECRET = 'Client Secret';
9 -const path = require('path'); 9 +//const path = require('path');
10 -const HTTPS = require('https'); 10 +//const HTTPS = require('https');
11 -const domain = "www.chatosscjh.tk" 11 +//const domain = "www.chatosscjh.tk"
12 const sslport = 23023; 12 const sslport = 23023;
13 13
14 //const indexRoute = require("./routes/index"); 14 //const indexRoute = require("./routes/index");
...@@ -218,17 +218,21 @@ function trans(message, totrans){ ...@@ -218,17 +218,21 @@ function trans(message, totrans){
218 }); 218 });
219 }; 219 };
220 220
221 -try { 221 +app.listen(sslport, function(){
222 - const option = { 222 + console.log('listen',sslport);
223 - ca: fs.readFileSync('/etc/letsencrypt/live/' + domain +'/fullchain.pem'), 223 + });
224 - key: fs.readFileSync(path.resolve(process.cwd(), '/etc/letsencrypt/live/' + domain +'/privkey.pem'), 'utf8').toString(), 224 +
225 - cert: fs.readFileSync(path.resolve(process.cwd(), '/etc/letsencrypt/live/' + domain +'/cert.pem'), 'utf8').toString(), 225 +//try {
226 - }; 226 +// const option = {
227 - 227 +// ca: fs.readFileSync('/etc/letsencrypt/live/' + domain +'/fullchain.pem'),
228 - HTTPS.createServer(option, app).listen(sslport, () => { 228 +// key: fs.readFileSync(path.resolve(process.cwd(), '/etc/letsencrypt/live/' + domain +'/privkey.pem'), 'utf8').toString(),
229 - console.log(`[HTTPS] Server is started on port ${sslport}`); 229 +// cert: fs.readFileSync(path.resolve(process.cwd(), '/etc/letsencrypt/live/' + domain +'/cert.pem'), 'utf8').toString(),
230 - }); 230 +// };
231 - } catch (error) { 231 +//
232 - console.log('[HTTPS] HTTPS 오류가 발생하였습니다. HTTPS 서버는 실행되지 않습니다.'); 232 +// HTTPS.createServer(option, app).listen(sslport, () => {
233 - console.log(error); 233 +// console.log(`[HTTPS] Server is started on port ${sslport}`);
234 - } 234 +// });
235 +// } catch (error) {
236 +// console.log('[HTTPS] HTTPS 오류가 발생하였습니다. HTTPS 서버는 실행되지 않습니다.');
237 +// console.log(error);
238 +// }
......