Skip to content

Commit 8cfcbce

Browse files
authored
Merge pull request #6 from oslabs-beta/pete/dotenv
updated UserModel.ts file to use dotenv for URI privacy. installed do…
2 parents f446fd1 + 443bf0d commit 8cfcbce

4 files changed

Lines changed: 7 additions & 3 deletions

File tree

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# This is an example .env file for you to create in order to insert your private URI for /electron
2+
# Your .env file should live in the root directory for the current configuration used in UserModel.ts
3+
MONGO_URI='<MongoDB-URI-for-private-User-DB-here>'

electron/models/UserModel.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import 'dotenv/config';// Imported dotenv to process env files to protect our URI
12
// Insert the MongoDB URI for your private User database in place of the example URI provided below.
2-
const MONGO_URI = 'mongodb+srv://chronoschild15:Codesmith999@cluster0.abrbjlj.mongodb.net/';
3+
const MONGO_URI = process.env.MONGO_URI;//URI from .env file in electron folder root directory
34

45
const mongoose = require('mongoose');
56

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"d3": "^7.8.5",
2626
"dat.gui": "^0.7.9",
2727
"docker": "^0.2.14",
28-
"dotenv": "^16.0.3",
28+
"dotenv": "^16.4.7",
2929
"electron-devtools-installer": "^3.2.0",
3030
"electron-fetch": "^1.9.1",
3131
"electron-log": "^5.0.0-beta.23",

0 commit comments

Comments
 (0)