From f9c1d5ac4cbe4ea0082b757b2112d62870d0b0e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Fri, 29 May 2026 22:19:04 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=BD=D0=B5=20=D0=BF=D0=B0=D0=B4=D0=B0?= =?UTF-8?q?=D1=82=D1=8C=20=D0=B1=D0=B5=D0=B7=20=D0=91=D0=94,=20=D0=B4?= =?UTF-8?q?=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D1=82=D1=8C=20.gitignore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 7 +++++++ server.js | 17 ++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..90aeeae --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +.env +node_modules/ +__pycache__/ +*.pyc +.DS_Store +.vscode/ +.idea/ diff --git a/server.js b/server.js index f11a6c5..5c2138b 100644 --- a/server.js +++ b/server.js @@ -31,15 +31,10 @@ app.get('/', (req, res) => { res.render('index', { title: 'IP WhiteList' }); }); -async function start() { - try { - const ok = await checkConnection(); - console.log('DB connected:', ok); - app.listen(PORT, () => console.log(`Server on port ${PORT}`)); - } catch (e) { - console.error('DB connection failed:', e.message); - process.exit(1); - } -} +// Не падаем если БД недоступна — healthcheck покажет статус +let dbOk = false; +checkConnection() + .then(() => { dbOk = true; console.log('DB connected'); }) + .catch((e) => console.error('DB not ready:', e.message)); -start(); +app.listen(PORT, () => console.log(`Server on port ${PORT}`));