Skip to content

Commit def1062

Browse files
committed
updates to securing user database
1 parent 5a0d498 commit def1062

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

electron/models/UserModel.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
require('dotenv').config();
22

33
// INSERT URI TO MONGODB TO SET UP USER DATABASE
4-
const MONGO_URI = process.env.USER_DB_URI;
4+
const MONGO_URI = `${process.env.USER_DB_URI}`;
55
console.log(MONGO_URI);
6-
// const MONGO_URI = process.env.CHRONOS_USER_DB_URI;
76
const mongoose = require('mongoose');
87

98
const userDB = mongoose.createConnection(MONGO_URI);

utilities/copyDist.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ fse.copyFileSync(
2929
path.resolve(__dirname, '../dist/package.json')
3030
);
3131

32+
// Copy .env from root directory into webpack's /dist folder
33+
// so that the necessary env variables are available
34+
fse.copyFileSync(path.resolve(__dirname, '../.env'), path.resolve(__dirname, '../build/.env'));
35+
3236
// Copy tsc'd electron code from /build to webpack's /dist folder
3337
sourceDir = path.resolve(__dirname, '../build');
3438
destDir = path.resolve(__dirname, '../dist/build');

0 commit comments

Comments
 (0)