Skip to content

Commit e53d563

Browse files
committed
[PRAC/ret] Correct "server" logic file
Correct/temporary folder organiz "/tmp/db.json" (based on the "flag"). core: B-3 / JS-BL
1 parent b9d5bb3 commit e53d563

File tree

1 file changed

+2
-1
lines changed
  • core-courses/3-js-basic-level/practicum-js-basic-level/sb-crm-server

1 file changed

+2
-1
lines changed

core-courses/3-js-basic-level/practicum-js-basic-level/sb-crm-server/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ const { createServer } = require("http");
88
// const DB_FILE = process.env.DB_FILE || "./db.json";
99

1010
// !! [FOR DEMO - Render] организация временной папки /tmp/db.json, для работы с Render
11-
const DB_FILE = process.env.DB_FILE || "/tmp/db.json";
11+
const isRender = process.env.RENDER || false; // проверка/понимание, где запускается сервер.. на Render
12+
const DB_FILE = isRender ? "/tmp/db.json" : "./db.json";
1213

1314
// номер порта, на котором будет запущен сервер
1415
const PORT = process.env.PORT || 3000;

0 commit comments

Comments
 (0)