Merge pull request #4 from flotte-goes-smart/feature/environment-variables

Switch to environment variables for database url
pull/7/head^2
Trivernis 4 years ago committed by GitHub
commit 44689aed4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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