최현준

도메인 연결

Showing 1 changed file with 22 additions and 2 deletions
......@@ -8,6 +8,11 @@ const PAPAGO_ID = 'tA41WEd_nbzy0nZcUQks'
const PAPAGO_SECRET = '6DHwov9gg2'
const WEATHER_TARGET_URL = 'http://apis.data.go.kr/1360000/VilageFcstInfoService/getVilageFcst';
const weather_key = 'CuIdcpULvcissE3Jk7AyAXok4bR4j6xyNkhfmWxOI9%2BxCs%2FkI%2F4v4j4rz3DDsQZVeuJTrWQhzQ3CV4JkeykMSw%3D%3D';
const fs = require('fs');
const path = require('path');
const HTTPS = require('https');
const domain = "www.theia17.tk"
const sslport = 23023;
const bodyParser = require('body-parser');
var app = express();
var async = require('async');
......@@ -382,6 +387,21 @@ function weather_get (url, User_Location)
});
}
app.listen(3000, function () {
console.log('Linebot listening on port 3000!');
try {
const option = {
ca: fs.readFileSync('/etc/letsencrypt/live/' + domain +'/fullchain.pem'),
key: fs.readFileSync(path.resolve(process.cwd(), '/etc/letsencrypt/live/' + domain +'/privkey.pem'), 'utf8').toString(),
cert: fs.readFileSync(path.resolve(process.cwd(), '/etc/letsencrypt/live/' + domain +'/cert.pem'), 'utf8').toString(),
};
HTTPS.createServer(option, app).listen(sslport, () => {
console.log(`[HTTPS] Server is started on port ${sslport}`);
});
} catch (error) {
console.log('[HTTPS] HTTPS 오류가 발생하였습니다. HTTPS 서버는 실행되지 않습니다.');
console.log(error);
}
app.listen(23023, function () {
console.log('Linebot listening on port 23023!');
});
\ No newline at end of file
......