fix: CORS settings

This commit is contained in:
Oleg Proskurin 2025-10-04 01:29:59 +07:00
parent ea680f4c5e
commit 960183c9c4
1 changed files with 6 additions and 10 deletions

View File

@ -27,17 +27,13 @@ export const appConfig: Config = {
export const createApp = (): Application => {
const app = express();
// Middleware - CORS configuration
const corsOrigin = process.env['CORS_ORIGIN']?.split(',') || [
'http://localhost:3001', // Landing
'http://localhost:3002', // Studio
'http://localhost:3003', // Admin
'*' // Allow all for development
];
// Middleware - CORS configuration (allow all origins)
app.use(cors({
origin: corsOrigin,
credentials: true
origin: true, // Allow all origins
credentials: true,
methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],
allowedHeaders: ['Content-Type', 'Authorization', 'X-API-Key'],
exposedHeaders: ['X-Request-ID']
}));
app.use(express.json({ limit: '10mb' }));