krishgokul92 commited on
Commit
8e05be8
·
verified ·
1 Parent(s): 1951e91

Update server.js

Browse files
Files changed (1) hide show
  1. server.js +3 -1
server.js CHANGED
@@ -14,8 +14,10 @@ const io = new Server(server, {
14
  // Serve static files
15
  app.use(express.static(path.join(__dirname, 'public')));
16
 
17
- // Handle the routes directly
18
  app.get('/', (req, res) => res.sendFile(path.join(__dirname, 'public', 'admin.html')));
 
 
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
 
 
14
  // Serve static files
15
  app.use(express.static(path.join(__dirname, 'public')));
16
 
17
+ // Handle root as redirect to /admin by default
18
  app.get('/', (req, res) => res.sendFile(path.join(__dirname, 'public', 'admin.html')));
19
+
20
+ // Serve /admin and /client dynamically (handling routing for both)
21
  app.get('/admin', (req, res) => res.sendFile(path.join(__dirname, 'public', 'admin.html')));
22
  app.get('/client', (req, res) => res.sendFile(path.join(__dirname, 'public', 'client.html')));
23