fix: CORS settings
This commit is contained in:
parent
ea680f4c5e
commit
960183c9c4
|
|
@ -27,17 +27,13 @@ export const appConfig: Config = {
|
||||||
export const createApp = (): Application => {
|
export const createApp = (): Application => {
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
// Middleware - CORS configuration
|
// Middleware - CORS configuration (allow all origins)
|
||||||
const corsOrigin = process.env['CORS_ORIGIN']?.split(',') || [
|
|
||||||
'http://localhost:3001', // Landing
|
|
||||||
'http://localhost:3002', // Studio
|
|
||||||
'http://localhost:3003', // Admin
|
|
||||||
'*' // Allow all for development
|
|
||||||
];
|
|
||||||
|
|
||||||
app.use(cors({
|
app.use(cors({
|
||||||
origin: corsOrigin,
|
origin: true, // Allow all origins
|
||||||
credentials: true
|
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' }));
|
app.use(express.json({ limit: '10mb' }));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue