We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b9d5bb3 commit e53d563Copy full SHA for e53d563
core-courses/3-js-basic-level/practicum-js-basic-level/sb-crm-server/index.js
@@ -8,7 +8,8 @@ const { createServer } = require("http");
8
// const DB_FILE = process.env.DB_FILE || "./db.json";
9
10
// !! [FOR DEMO - Render] организация временной папки /tmp/db.json, для работы с Render
11
-const DB_FILE = process.env.DB_FILE || "/tmp/db.json";
+const isRender = process.env.RENDER || false; // проверка/понимание, где запускается сервер.. на Render
12
+const DB_FILE = isRender ? "/tmp/db.json" : "./db.json";
13
14
// номер порта, на котором будет запущен сервер
15
const PORT = process.env.PORT || 3000;
0 commit comments