aboutsummaryrefslogtreecommitdiff
path: root/index.ts
diff options
context:
space:
mode:
authorEugene Sokolov <eug-vs@keemail.me>2020-11-07 12:00:44 +0200
committerGitHub <noreply@github.com>2020-11-07 12:00:44 +0200
commite01d2e695f66127673b53fb25267b9f6096c59a6 (patch)
tree726251ea347c13d3d329cce8fc6fcb07744c977e /index.ts
parentafd2f44d3fd814953ff850ac3c5aec1acd9d8da1 (diff)
parentaaf784ab9fe5894c18493f116c6599faf3c92895 (diff)
downloadwhich-api-e01d2e695f66127673b53fb25267b9f6096c59a6.tar.gz
Merge pull request #24 from which-ecosystem/dockerizationHEADmaster
Dockerization + migration to Mongo Atlas
Diffstat (limited to 'index.ts')
-rw-r--r--index.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/index.ts b/index.ts
index e2146cd..eec102d 100644
--- a/index.ts
+++ b/index.ts
@@ -6,10 +6,13 @@ import app from './app';
mongoose.Promise = Promise;
-const MONGODB_URL = process.env.MONGODB_URI || 'mongodb://localhost:27017/which';
const PORT = process.env.PORT || 3030;
+const MONGODB_URL = process.env.MONGODB_URI || 'mongodb://localhost:27017/which';
+const { MONGODB_USER, MONGODB_PASSWORD } = process.env;
mongoose.connect(MONGODB_URL, {
+ user: MONGODB_USER,
+ pass: MONGODB_PASSWORD,
useNewUrlParser: true,
useUnifiedTopology: true,
useCreateIndex: true,