Add database configuration environment variables

This commit is contained in:
Shadowfacts 2019-08-18 18:15:52 -04:00
parent ce30ca9d34
commit ac7b7bb92c
Signed by untrusted user: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 5 additions and 5 deletions

View File

@ -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": [