Merge branch 'main' into dev-entities

pull/7/head
leonnicolas 4 years ago committed by GitHub
commit ebf51eaa07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3,13 +3,10 @@ WORKDIR /
COPY ./src /src
COPY ./package*.json ./
COPY ./gulpfile.js ./
COPY ./ormconfig.json ./
RUN npm install
RUN npm install -g gulp
RUN npm install gulp
RUN gulp
EXPOSE 4000
CMD ["npm", "start"]

@ -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"
]
}

@ -7,6 +7,7 @@ import { createConnection } from 'typeorm';
import { UserServerAPI } from './datasources/userserver/userserviceAPI';
import express from 'express';
import { requiredPermissions } from './datasources/userserver/permission';
import { CargoBike } from './model/CargoBike';
require('dotenv').config();
@ -37,7 +38,15 @@ async function authenticate (req: any, res: any, next: any) {
}
}
createConnection().then(async () => {
createConnection({
type: 'postgres',
url: process.env.POSTGRES_CONNECTION_URL,
entities: [
CargoBike
],
synchronize: true,
logging: false
}).then(async () => {
console.log('connected to db');
}).catch(error => console.log(error));

Loading…
Cancel
Save