Skip to content

Commit afa1cef

Browse files
committed
Added db envs
1 parent 66173b7 commit afa1cef

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

TODO.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# TODO
22

3-
- Добавить переменные среды для БД
43
- Добавить команду для вывода импортированных заметок с ошибками
54
- Добавить команду повторного импорта заметок с ошибками

src/db.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import pg from 'pg'
22

33
const pool = new pg.Pool({
4-
host: 'localhost',
5-
database: 'notion',
6-
user: 'phpusr'
4+
host: process.env.DB_HOST || 'localhost',
5+
database: process.env.DB_NAME || 'notion',
6+
user: process.env.DB_USER || 'phpusr',
7+
password: process.env.DB_PASSWORD || ''
78
})
89

910
export async function loadImportStatuses() {

0 commit comments

Comments
 (0)