forked from shadowfacts/shadowfacts.net
Add database configuration environment variables
This commit is contained in:
parent
ce30ca9d34
commit
ac7b7bb92c
10
lib/index.ts
10
lib/index.ts
|
@ -34,11 +34,11 @@ async function generate(): Promise<Page[]> {
|
|||
|
||||
const connection = await createConnection({
|
||||
"type": "postgres",
|
||||
"host": "localhost",
|
||||
"port": 5432,
|
||||
"username": "blog",
|
||||
"password": "blog",
|
||||
"database": "blog",
|
||||
"host": process.env.DB_HOST || "localhost",
|
||||
"port": process.env.DB_PORT ? parseInt(process.env.DB_PORT) : 5432,
|
||||
"username": process.env.DB_USERNAME || "blog",
|
||||
"password": process.env.DB_PASSWORD || "blog",
|
||||
"database": process.env.DB_DATABASE || "blog",
|
||||
"synchronize": true,
|
||||
"logging": true,
|
||||
"entities": [
|
||||
|
|
Loading…
Reference in New Issue