krishgokul92 commited on
Commit
52f8019
·
verified ·
1 Parent(s): 53b045a

Update server.js

Browse files
Files changed (1) hide show
  1. server.js +3 -5
server.js CHANGED
@@ -14,15 +14,13 @@ const io = new Server(server, {
14
  // Serve static files from /public
15
  app.use(express.static(path.join(__dirname, 'public')));
16
 
17
- // Fix: Ensure routes for /admin and /client work
18
- app.get('/', (req, res) => res.sendFile(path.join(__dirname, 'public', 'admin.html'))); // Default is admin
19
- app.get('/admin', (req, res) => res.sendFile(path.join(__dirname, 'public', 'admin.html')));
20
- app.get('/client', (req, res) => res.sendFile(path.join(__dirname, 'public', 'client.html')));
21
 
22
  const HOST = '0.0.0.0';
23
  const PORT = process.env.PORT || 7860;
24
 
25
- // Socket handling
26
  io.on('connection', (socket) => {
27
  const room = socket.handshake.query.room || 'default';
28
  const role = socket.handshake.query.role || 'client';
 
14
  // Serve static files from /public
15
  app.use(express.static(path.join(__dirname, 'public')));
16
 
17
+ // Serve only the root route
18
+ app.get('/', (req, res) => res.sendFile(path.join(__dirname, 'public', 'index.html')));
 
 
19
 
20
  const HOST = '0.0.0.0';
21
  const PORT = process.env.PORT || 7860;
22
 
23
+ // Socket.io handling
24
  io.on('connection', (socket) => {
25
  const room = socket.handshake.query.room || 'default';
26
  const role = socket.handshake.query.role || 'client';