forked from alexindevs/uliuwa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
58 lines (43 loc) · 1.39 KB
/
index.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
const express = require('express');
const bodyParser = require('body-parser');
const path = require('path');
const app = express();
app.use((req, res, next) => {
res.setHeader('Cache-Control', 'no-cache, no-store, must-revalidate');
res.setHeader('Pragma', 'no-cache');
res.setHeader('Expires', '0');
next();
});
// Middleware
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
// Serve static files
app.use(express.static(path.join(__dirname, 'public')));
app.use('/vendor', express.static('node_modules'));
// Routes
app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'index.html'));
});
app.get('/artists', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'artistSelection.html'));
});
app.get('/about-us', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'about.html'));
});
app.get('/artist', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'artist.html'));
});
app.get('/contact', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'contact.html'));
});
app.get('/exhibitions', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'exhibitions.html'));
});
app.get('/exhibition', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'exhibition.html'));
});
// Start the server
const port = 5000;
app.listen(port, () => {
console.log(`Server running on port ${port}`);
});