feat: новая функция

This commit is contained in:
2025-11-12 21:22:03 +03:00
parent f23307ded5
commit 6cca7b7c0c
4 changed files with 77 additions and 11 deletions

View File

@@ -26,14 +26,28 @@ const PORT = process.env.PORT || 3000;
const wss = new WebSocket.Server({
server,
cors: {
origin: ['http://localhost:5173', 'http://localhost:8000', 'http://127.0.0.1:5173', 'http://127.0.0.1:8000'],
origin: [
'http://localhost:5173',
'http://localhost:8000',
'http://localhost:9000',
'https://localhost:9443',
'http://127.0.0.1:5173',
'http://127.0.0.1:8000'
],
credentials: true
}
});
// Middleware
app.use(cors({
origin: ['http://localhost:5173', 'http://localhost:8000', 'http://127.0.0.1:5173', 'http://127.0.0.1:8000'],
origin: [
'http://localhost:5173',
'http://localhost:8000',
'http://localhost:9000',
'https://localhost:9443',
'http://127.0.0.1:5173',
'http://127.0.0.1:8000'
],
credentials: true
}));
app.use(express.json({ limit: '10mb' }));