diff options
author | eug-vs <eug-vs@keemail.me> | 2020-11-07 12:27:41 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-11-07 12:28:49 +0300 |
commit | 59bb116afd8d2be1cdd4ccf45a646d58eabab357 (patch) | |
tree | 6a68c5ec1bf4a69a51a1a44e2cc6e216e5aacb31 | |
parent | 1b48b401ad64f0b8994338fd88dad78d78be3bf0 (diff) | |
download | which-api-59bb116afd8d2be1cdd4ccf45a646d58eabab357.tar.gz |
feat: add MONGODB_USER and MONGODB_PASSWORD vars
-rw-r--r-- | index.ts | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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, |