From 59bb116afd8d2be1cdd4ccf45a646d58eabab357 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sat, 7 Nov 2020 12:27:41 +0300 Subject: feat: add MONGODB_USER and MONGODB_PASSWORD vars --- index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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, -- cgit v1.2.3