Spaces:
Paused
Paused
plsgivemeachane commited on
Commit ·
9933c8e
1
Parent(s): 9f46b96
try to fix part 2 of the fuking hell socket.io 2
Browse files
index.js
CHANGED
|
@@ -15,11 +15,13 @@ const prisma = new PrismaClient()
|
|
| 15 |
const app = express()
|
| 16 |
const http = require('http');
|
| 17 |
const server = http.createServer(app);
|
| 18 |
-
const { Server } = require("socket.io");
|
| 19 |
const { type } = require('os');
|
| 20 |
-
const io =
|
| 21 |
maxHttpBufferSize: 1e8,
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
| 23 |
});
|
| 24 |
|
| 25 |
const SALT = process.env.PRIVATE_KEY
|
|
|
|
| 15 |
const app = express()
|
| 16 |
const http = require('http');
|
| 17 |
const server = http.createServer(app);
|
|
|
|
| 18 |
const { type } = require('os');
|
| 19 |
+
const io = require("socket.io")(server, {
|
| 20 |
maxHttpBufferSize: 1e8,
|
| 21 |
+
cors: {
|
| 22 |
+
origin: "*",
|
| 23 |
+
methods: ["GET", "POST"],
|
| 24 |
+
}
|
| 25 |
});
|
| 26 |
|
| 27 |
const SALT = process.env.PRIVATE_KEY
|