Switch to environment variables for database url

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/4/head
trivernis 4 years ago
parent 623fd9e593
commit 13578d8c9b
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -1,12 +0,0 @@
{
"type": "postgres",
"host": "127.17.42.1",
"port": 5432,
"username": "apollo",
"database": "apollo_test",
"synchronize": true,
"logging": false,
"entities": [
"dist/model/**/*.js"
]
}

@ -37,7 +37,10 @@ async function authenticate (req: any, res: any, next: any) {
} }
} }
createConnection().then(async () => { createConnection({
type: 'postgres',
url: process.env.POSTGRES_CONNECTION_URL
}).then(async () => {
console.log('connected to db'); console.log('connected to db');
}).catch(error => console.log(error)); }).catch(error => console.log(error));

Loading…
Cancel
Save