Skip to content

Commit e9ca0b4

Browse files
committed
fix: remove dotenv in production, update mobile API URL
1 parent 3d42f59 commit e9ca0b4

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

backend/config/db.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
const mongoose = require('mongoose');
2-
const dotenv = require('dotenv');
3-
4-
dotenv.config();
52

63
const connectDB = async () => {
74
try {
85
const conn = await mongoose.connect(process.env.MONGO_URI);
9-
console.log(`Connection established with MongoDB: ${conn.connection.host}`);
6+
console.log(`Connected to MongoDB: ${conn.connection.host}`);
107
} catch (error) {
11-
console.error(`Something went wrong: ${error.message}`);
8+
console.error(`DB Error: ${error.message}`);
129
process.exit(1);
1310
}
1411
};

backend/server.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const express = require('express');
2-
const dotenv = require('dotenv');
32
const cors = require('cors');
43
const helmet = require('helmet');
54
const morgan = require('morgan');
@@ -8,7 +7,9 @@ const userRoutes = require('./routes/userRoutes');
87
const productRoutes = require('./routes/productRoutes');
98
const paymentRoutes = require('./routes/paymentRoutes');
109

11-
dotenv.config();
10+
if (process.env.NODE_ENV !== 'production') {
11+
require('dotenv').config();
12+
}
1213

1314
connectDB();
1415

mobile/src/screens/CheckoutScreen.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { colors } from '../theme/colors';
66
import { useApp } from '../context/AppContext';
77
import RazorpayCheckout from 'react-native-razorpay';
88

9-
const API_URL = 'http://10.254.200.236:5001';
9+
const API_URL = 'https://zappify-dz5a.vercel.app';
1010
const RAZORPAY_KEY_ID = 'rzp_test_SZtLthHdKYuLeQ';
1111

1212
const STEPS = ['MY BAG', 'ADDRESS', 'PAYMENT'];

0 commit comments

Comments
 (0)