-
Notifications
You must be signed in to change notification settings - Fork 1
/
server.js
32 lines (25 loc) · 829 Bytes
/
server.js
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
const express = require('express');
const path = require('path');
const app = express();
const port = 3000;
app.use(express.static('public'));
// Serve the index page
app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, 'public/index.html'));
});
// Serve challenge pages
app.get('/challenge1.html', (req, res) => {
res.sendFile(path.join(__dirname, 'public/challenge1.html'));
});
app.get('/challenge2.html', (req, res) => {
res.sendFile(path.join(__dirname, 'public/challenge2.html'));
});
app.get('/challenge3.html', (req, res) => {
res.sendFile(path.join(__dirname, 'public/challenge3.html'));
});
app.get('/challenge4.html', (req, res) => {
res.sendFile(path.join(__dirname, 'public/challenge4.html'));
});
app.listen(port, () => {
console.log(`Server running at http://localhost:${port}`);
});