JKL

Update_Server

Showing 1 changed file with 5 additions and 0 deletions
const express = require('express');
const express = require('express');
const fs = require('fs');
const path = require('path');
const HTTPS = require('https');
......@@ -6,6 +7,8 @@ const domain = "2020105107.osschatbot.cf"
const sslport = 23023;
const app = express();
const app = express();
app.use(express.urlencoded({ extended: false }));
app.use(express.json());
......@@ -143,6 +146,7 @@ app.post('/message', (req, res) => {
res.json(data);
});
try {
const option = {
ca: fs.readFileSync('/etc/letsencrypt/live/' + domain +'/fullchain.pem'),
......@@ -157,3 +161,4 @@ try {
console.log('[HTTPS] HTTPS 오류가 발생하였습니다. HTTPS 서버는 실행되지 않습니다.');
console.log(error);
}
......