-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
62 lines (48 loc) · 1.73 KB
/
app.js
File metadata and controls
62 lines (48 loc) · 1.73 KB
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
59
60
61
62
const express = require('express');
const path = require('path');
const app = express();
const PORT = 8080;
app.use('/', express.static(path.join(__dirname +'/public')))
app.get('/chillgames', (req, res) => {
res.sendFile(__dirname + '/public/templates/chill.html')
})
app.get('/tryhardgames', (req, res) => {
res.sendFile(__dirname + '/public/templates/tryhard.html')
})
app.get('/about', (req, res) => {
res.sendFile(__dirname + '/public/templates/about.html')
})
app.get('/tryhardgames/memorytest', (req, res) => {
res.sendFile(__dirname + '/public/templates/memoryTest.html')
})
app.get('/tryhardgames/reactiontime', (req, res) => {
res.sendFile(__dirname + '/public/templates/reactionTime.html')
})
app.get('/tryhardgames/typingtest', (req, res) => {
res.sendFile(__dirname + '/public/templates/typingTest.html')
})
app.get('/chillgames/snake', (req, res) => {
res.sendFile(__dirname + '/public/templates/snake.html')
})
app.get ('/chillgames/tictactoe', (req, res) => {
res.sendFile(__dirname + '/public/templates/tictactoe.html')
})
app.get('/tryhardgames/bubblesort', (req, res) => {
res.sendFile(__dirname + '/public/templates/bubbleSort.html')
})
app.get('/chillgames/taptheyanis', (req, res) => {
res.sendFile(__dirname + '/public/templates/tapTheYanis.html')
})
app.get('/chillgames/memorygame', (req, res) => {
res.sendFile(__dirname + '/public/templates/memoryGame.html')
})
app.get('/tryhardgames/blackjack', (req, res) => {
res.sendFile(__dirname + '/public/templates/blackjack.html')
})
app.use((req, res) => {
res.status(404)
res.sendFile(__dirname + '/public/templates/404.html')
})
app.listen(PORT, async () => {
console.log('Server launched on http://localhost:' + PORT);
})