This commit is contained in:
Rene Kievits
2025-12-18 01:30:52 +01:00
commit 6438660b03
78 changed files with 14230 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
export const PORT = process.env.PORT || 3000;
export const MONGO_URI = process.env.MONGO_URI || 'mongodb://mongo:27017/zenkanji';
export const SRS_TIMINGS_HOURS = [0, 0, 4, 8, 23, 47];
export const JWT_SECRET = process.env.JWT_SECRET;

12
server/src/config/db.js Normal file
View File

@@ -0,0 +1,12 @@
import mongoose from 'mongoose';
import { MONGO_URI } from './constants.js';
export const connectDB = async () => {
try {
await mongoose.connect(MONGO_URI);
console.log('✅ Connected to MongoDB');
} catch (err) {
console.error('❌ MongoDB Connection Error:', err);
process.exit(1);
}
};