Skip to content

Commit ee715a8

Browse files
committed
Fix .env
1 parent a4ee45f commit ee715a8

File tree

8 files changed

+15
-11
lines changed

8 files changed

+15
-11
lines changed

.env.development

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
DB_URI=mongodb+srv://nufacturing:dO6^M7u2Pf9Bf0Q#@nufacturing0.2n3i3rk.mongodb.net/nufacturing-development-db?retryWrites=true&w=majority&appName=Nufacturing0
1+
DB_URI=mongodb://localhost:27017/nufacturing-local-db
22
JWT_SECRET=c551591808a16b19a0c2cf7956aef9009ce27295d25bce18b2953690786e9359
33
EMAIL_USER=ahim@brcodex.com.np
44
EMAIL_PASS=Iamlocked_11
5-
5+

.env.local

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
DB_URI=mongodb+srv://nufacturing:localhost:27017/nufacturing-local-db
1+
DB_URI=mongodb://localhost:27017/nufacturing-local-db
22
JWT_SECRET=c551591808a16b19a0c2cf7956aef9009ce27295d25bce18b2953690786e9359
33
EMAIL_USER=ahim@brcodex.com.np
44
EMAIL_PASS=Iamlocked_11
5+

.env.production

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
DB_URI=mongodb+srv://nufacturing:kIVFunOvCwVyVrOT@nufacturing0.2n3i3rk.mongodb.net/nufacturing-production-db?retryWrites=true&w=majority&appName=Nufacturing0
1+
DB_URI=mongodb://localhost:27017/nufacturing-local-db
22
JWT_SECRET=c551591808a16b19a0c2cf7956aef9009ce27295d25bce18b2953690786e9359
33
EMAIL_USER=ahim@brcodex.com.np
4-
EMAIL_PASS=Iamlocked_11
4+
EMAIL_PASS=Iamlocked_11
5+

.env.staging

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
DB_URI=mongodb+srv://nufacturing:kIVFunOvCwVyVrOT@nufacturing0.2n3i3rk.mongodb.net/nufacturing-staging-db?retryWrites=true&w=majority&appName=Nufacturing0
1+
DB_URI=mongodb://localhost:27017/nufacturing-local-db
22
JWT_SECRET=c551591808a16b19a0c2cf7956aef9009ce27295d25bce18b2953690786e9359
33
EMAIL_USER=ahim@brcodex.com.np
4-
EMAIL_PASS=Iamlocked_11
4+
EMAIL_PASS=Iamlocked_11
5+

logs/app.log

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,5 @@
9292
{"level":"info","message":"Connected to MongoDB for logging.","timestamp":"2024-08-01T00:33:29.259Z"}
9393
{"level":"info","message":"Logger initialized.","timestamp":"2024-08-01T00:34:38.539Z"}
9494
{"level":"info","message":"Connected to MongoDB for logging.","timestamp":"2024-08-01T00:34:38.726Z"}
95+
{"level":"info","message":"Logger initialized.","timestamp":"2024-08-02T09:10:47.612Z"}
96+
{"level":"info","message":"Connected to MongoDB for logging.","timestamp":"2024-08-02T09:10:47.815Z"}

src/config/db.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ require('dotenv').config();
66
// Connect to MongoDB and add MongoDB transport
77
const connectDB = async () => {
88
try {
9+
console.log(process.env.DB_URI);
910
await mongoose.connect(process.env.DB_URI);
10-
1111
logger.add(new transports.MongoDB({
1212
db: process.env.DB_URI,
1313
collection: 'logs',

src/config/logger.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ const logger = createLogger({
99
format.json()
1010
),
1111
transports: [
12-
new transports.Console(),
13-
new transports.File({ filename: 'logs/app.log' }),
1412
new transports.Console({ format: format.simple(), level: 'error' }),
13+
new transports.File({ filename: 'logs/app.log' }),
1514
],
1615
});
1716

0 commit comments

Comments
 (0)