aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-10-07 20:14:57 +0300
committereug-vs <eug-vs@keemail.me>2020-10-07 20:14:57 +0300
commit1229c5a4c76411617dc8eb8575f26bc35afb92b2 (patch)
tree1da41c0ed96cce1262239515b516f5d6c9f929ce
parent052212ef180af5a86fa4b79094a25802f0184139 (diff)
downloadwhich-api-1229c5a4c76411617dc8eb8575f26bc35afb92b2.tar.gz
feat: load .env in runtime
-rw-r--r--env.ts4
-rw-r--r--index.ts1
2 files changed, 5 insertions, 0 deletions
diff --git a/env.ts b/env.ts
new file mode 100644
index 0000000..60874cc
--- /dev/null
+++ b/env.ts
@@ -0,0 +1,4 @@
+import { config } from 'dotenv';
+
+const { parsed } = config();
+export default parsed;
diff --git a/index.ts b/index.ts
index 9ba0431..e2146cd 100644
--- a/index.ts
+++ b/index.ts
@@ -1,5 +1,6 @@
import mongoose from 'mongoose';
import Promise from 'bluebird';
+import './env';
import app from './app';
mongoose.Promise = Promise;