CORS whitelist for NodeJS

This commit is contained in:
Thanakorn S
2026-05-27 11:26:40 +07:00
parent aee797b998
commit ebccca4989
+1 -1
View File
@@ -7,7 +7,7 @@ const { Server } = require('socket.io');
const app = express();
const httpServer = createServer(app);
const io = new Server(httpServer, {
cors: { origin: '*' }
cors: { origin: process.env.ALLOWED_ORIGIN || 'http://localhost' }
});
app.use(express.json());