This commit is contained in:
Amirreza
2026-07-06 01:55:55 +03:30
parent 4a874e3ed3
commit 85b0420836

View File

@@ -66,33 +66,13 @@ const { default: axios } = require('axios');
// }));
// // Socket.IO CORS
// const io = require('socket.io')(http, {
// cors: {
// origin: (origin, callback) => {
// if (process.env.NODE_ENV !== 'production') {
// return callback(null, true);
// }
// if (!origin) {
// return callback(null, true);
// }
// const isAllowed = allowedOrigins.some(item => {
// if (typeof item === 'string') return item === origin;
// if (item instanceof RegExp) return item.test(origin);
// return false;
// });
// if (isAllowed) {
// callback(null, true);
// } else {
// callback(new Error('Not allowed by CORS'));
// }
// },
// methods: ['GET', 'POST', 'PATCH', 'PUT', 'DELETE', 'OPTIONS'],
// credentials: true
// }
// });
const io = require('socket.io')(http, {
cors: {
origin: '*',
methods: ['GET', 'POST', 'PATCH', 'PUT', 'DELETE', 'OPTIONS'],
credentials: true
}
});
// افزایش limit برای Base64 (1000mb کافیه)
app.use(express.json({ limit: '1000mb' }));