chore: First entities setup, made connection to database, added central API to request environment variables for our app.
This commit is contained in:
parent
c07bb959cf
commit
78837fcc1b
8 changed files with 86 additions and 10 deletions
|
@ -1,9 +1,14 @@
|
|||
import { Options } from '@mikro-orm/core';
|
||||
import { PostgreSqlDriver } from '@mikro-orm/postgresql';
|
||||
import {Options} from '@mikro-orm/core';
|
||||
import {PostgreSqlDriver} from "@mikro-orm/postgresql";
|
||||
import {EnvVars, getEnvVar, getNumericEnvVar} from "./util/envvars";
|
||||
|
||||
const config: Options = {
|
||||
driver: PostgreSqlDriver,
|
||||
dbName: 'dwengo',
|
||||
host: getEnvVar(EnvVars.DbHost, {required: true}),
|
||||
port: getNumericEnvVar(EnvVars.DbPort, {defaultValue: 5432}),
|
||||
dbName: getEnvVar(EnvVars.DbName, {defaultValue: "dwengo"}),
|
||||
user: getEnvVar(EnvVars.DbUsername, {required: true}),
|
||||
password: getEnvVar(EnvVars.DbPassword, {required: true}),
|
||||
entities: ['dist/**/*.entity.js'],
|
||||
entitiesTs: ['src/**/*.entity.ts'],
|
||||
debug: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue