agregado cors para todo *.interno.com
All checks were successful
Deploy conversation layer / deploy (push) Successful in 2m56s
All checks were successful
Deploy conversation layer / deploy (push) Successful in 2m56s
This commit is contained in:
@@ -44,12 +44,19 @@ const app = express();
|
||||
|
||||
|
||||
app.use(cors({
|
||||
origin: 'http://localhost:5173',
|
||||
origin: (origin, callback) => {
|
||||
if (!origin || origin === 'http://localhost:5173' || /\.interno\.com$/.test(origin)) {
|
||||
callback(null, true);
|
||||
} else {
|
||||
callback(new Error('No permitido por CORS'));
|
||||
}
|
||||
},
|
||||
methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],
|
||||
credentials: true, // si usás cookies o headers personalizados
|
||||
credentials: true,
|
||||
}));
|
||||
|
||||
|
||||
|
||||
app.use(express.json());
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user