mirror of
https://github.com/ceratic/project_vollidioten_website.git
synced 2026-05-14 00:16:47 +02:00
feat: update CORS configuration and enhance player profile with Minecraft stats and tab navigation
This commit is contained in:
@@ -18,6 +18,11 @@ const CALLBACK_URL = process.env.CALLBACK_URL || 'http://localhost:3000/auth/dis
|
||||
const FRONTEND_URL = process.env.FRONTEND_URL || 'http://localhost:8000';
|
||||
const BACKEND_URL = process.env.BACKEND_URL || 'https://vollidioten.ceraticsoft.de';
|
||||
|
||||
// CORS configuration - allow multiple origins for development
|
||||
const corsOrigins = process.env.NODE_ENV === 'production'
|
||||
? [FRONTEND_URL]
|
||||
: [FRONTEND_URL, 'http://localhost:3000', 'http://localhost:8000', 'http://127.0.0.1:3000'];
|
||||
|
||||
// File upload configuration
|
||||
const UPLOAD_DIR = path.join(__dirname, 'uploads');
|
||||
if (!fs.existsSync(UPLOAD_DIR)) {
|
||||
@@ -55,7 +60,7 @@ init(); // Initialize DB
|
||||
|
||||
// Middleware
|
||||
app.use(express.json());
|
||||
app.use(cors({ origin: FRONTEND_URL, credentials: true }));
|
||||
app.use(cors({ origin: corsOrigins, credentials: true }));
|
||||
app.use(session({
|
||||
secret: process.env.SESSION_SECRET || 'dev_secret',
|
||||
resave: false,
|
||||
|
||||
Reference in New Issue
Block a user