Cors config
All checks were successful
gitea/minesweeper-backend/pipeline/head This commit looks good
All checks were successful
gitea/minesweeper-backend/pipeline/head This commit looks good
This commit is contained in:
parent
3b7894f644
commit
316a4ebe8d
14
index.js
14
index.js
@ -11,10 +11,20 @@ const { randomUUID } = require('crypto');
|
||||
|
||||
const app = express();
|
||||
app.use(cors({
|
||||
origin: "*"
|
||||
origin: "*",
|
||||
methods: ["GET", "POST"],
|
||||
allowedHeaders: ["Content-Type"],
|
||||
credentials: true
|
||||
}));
|
||||
const server = createServer(app);
|
||||
const io = new Server(server);
|
||||
const io = new Server(server, {
|
||||
cors: {
|
||||
origin: "*",
|
||||
methods: ["GET", "POST"],
|
||||
allowedHeaders: ["Content-Type"],
|
||||
credentials: true
|
||||
}
|
||||
});
|
||||
|
||||
io.on('connection', (socket) => {
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user