From 9e45b99f988e25a28e8a134d9693da2ef7805ae0 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Wed, 7 Jun 2023 13:31:11 +0200 Subject: [PATCH] config not an default but named export --- database/src/config/index.ts | 5 ++--- database/src/index.ts | 3 +-- database/src/prepare.ts | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/database/src/config/index.ts b/database/src/config/index.ts index ba41f11d4..4840f3f86 100644 --- a/database/src/config/index.ts +++ b/database/src/config/index.ts @@ -1,6 +1,7 @@ // ATTENTION: DO NOT PUT ANY SECRETS IN HERE (or the .env) import dotenv from 'dotenv' + dotenv.config() const constants = { @@ -35,6 +36,4 @@ if ( ) } -const CONFIG = { ...constants, ...database, ...migrations } - -export default CONFIG +export const CONFIG = { ...constants, ...database, ...migrations } diff --git a/database/src/index.ts b/database/src/index.ts index 48056ab55..96785a721 100644 --- a/database/src/index.ts +++ b/database/src/index.ts @@ -1,6 +1,5 @@ -import 'reflect-metadata' import { createDatabase } from './prepare' -import CONFIG from './config' +import { CONFIG } from './config' import { createPool } from 'mysql' import { Migration } from 'ts-mysql-migrate' diff --git a/database/src/prepare.ts b/database/src/prepare.ts index 3c64b1c5e..2ecbb4c42 100644 --- a/database/src/prepare.ts +++ b/database/src/prepare.ts @@ -1,6 +1,6 @@ import { createConnection } from 'mysql2/promise' -import CONFIG from './config' +import { CONFIG } from './config' export const createDatabase = async (): Promise => { const con = await createConnection({