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

Fix database entity settings
pull/7/head^2
Trivernis 4 years ago committed by GitHub
commit 6437e8743a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -7,6 +7,7 @@ import { createConnection } from 'typeorm';
import { UserServerAPI } from './datasources/userserver/userserviceAPI'; import { UserServerAPI } from './datasources/userserver/userserviceAPI';
import express from 'express'; import express from 'express';
import { requiredPermissions } from './datasources/userserver/permission'; import { requiredPermissions } from './datasources/userserver/permission';
import { CargoBike } from './model/CargoBike';
require('dotenv').config(); require('dotenv').config();
@ -39,7 +40,12 @@ async function authenticate (req: any, res: any, next: any) {
createConnection({ createConnection({
type: 'postgres', type: 'postgres',
url: process.env.POSTGRES_CONNECTION_URL url: process.env.POSTGRES_CONNECTION_URL,
entities: [
CargoBike
],
synchronize: true,
logging: false
}).then(async () => { }).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