Spaces:
Sleeping
Sleeping
Update server.js
Browse files
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
|
| 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 |
|