-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
33 lines (26 loc) · 864 Bytes
/
Copy pathserver.js
File metadata and controls
33 lines (26 loc) · 864 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const express = require('express');
const path = require('path');
const app = express();
const PORT = process.env.PORT || 3000;
// Serve static files
app.use(express.static(path.join(__dirname)));
// Routes
app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, 'index.html'));
});
// Handle other routes for your pages
app.get('/web', (req, res) => {
res.sendFile(path.join(__dirname, 'src/pages/web/index.html'));
});
app.get('/audio', (req, res) => {
res.sendFile(path.join(__dirname, 'src/pages/audio/index.html'));
});
app.get('/visual', (req, res) => {
res.sendFile(path.join(__dirname, 'src/pages/visual/index.html'));
});
app.get('/stuff', (req, res) => {
res.sendFile(path.join(__dirname, 'src/pages/stuff/index.html'));
});
app.listen(PORT, () => {
console.log(`Server is running on http://localhost:${PORT}`);
});