From a7fd89b7c22fcfd6e11d1081280aae29a7fc9851 Mon Sep 17 00:00:00 2001 From: Sven Czarnian Date: Sat, 22 Oct 2022 16:11:17 +0200 Subject: [PATCH] centrelize the configuration folder --- config/config.yaml | 4 ++++ src/config/Configuration.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 config/config.yaml diff --git a/config/config.yaml b/config/config.yaml new file mode 100644 index 0000000..ade21c0 --- /dev/null +++ b/config/config.yaml @@ -0,0 +1,4 @@ +database: + host: 'localhost' + port: 27017 + name: 'aman' \ No newline at end of file diff --git a/src/config/Configuration.ts b/src/config/Configuration.ts index 58483b0..3a9cb1f 100644 --- a/src/config/Configuration.ts +++ b/src/config/Configuration.ts @@ -4,6 +4,6 @@ import { join } from 'path'; export default () => { return yaml.load( - readFileSync(join(__dirname, 'config.yaml'), 'utf8'), + readFileSync(join(process.cwd(), 'config/config.yaml'), 'utf8'), ) as Record; };