From 4bd6215b8f83c7477223e85b10918e0296f50b34 Mon Sep 17 00:00:00 2001 From: Anatoly Kopyl Date: Thu, 21 Jan 2021 16:05:48 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BA=D0=BB=D1=8E=D1=87=D0=B8=20SSL=20=D0=BD=D0=B0=20=D0=B1?= =?UTF-8?q?=D1=8D=D0=BA=D0=B5=D0=BD=D0=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 4 ++-- server/index.js | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 22797f0..5c4b9a4 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,7 @@
- Обновить Толин эмодзи статус! + Обновить Толин эмодзи статус! - Что это? + Что это?
При каждом нажатии на большую кнопку мне дается новый случайно выбранный эмодзи статус. Открой vk.com/akopyl, нажми на кнопку на этом сайте и обнови мою страницу! diff --git a/server/index.js b/server/index.js index e932aa1..675fa4d 100644 --- a/server/index.js +++ b/server/index.js @@ -30,5 +30,12 @@ app.get('/update', (req, res) => { app.use(Express.static(path.join(__dirname, 'public'))); -app.listen(port, () => console.log('Dev server started on ' + port)); - +if (process.env.NODE_ENV === 'production') { + https.createServer({ + key: fs.readFileSync('/etc/letsencrypt/live/studybuddy.top/privkey.pem'), + cert: fs.readFileSync('/etc/letsencrypt/live/studybuddy.top/cert.pem') + }, app) + .listen(port, () => console.log('Prod server started on ' + port)); +} else { + app.listen(port, () => console.log('Dev server started on ' + port)); +}