-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
50 lines (38 loc) · 1.22 KB
/
server.js
File metadata and controls
50 lines (38 loc) · 1.22 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
const express = require('express')
const app = express()
const path = require('path')
const port = process.env.PORT || 8080
const http = require('http').Server(app)
app.get('/', (req, res) => {
res.sendFile(path.join(__dirname + '/src/Stony/secondPage.html'))
})
app.get('/map1', (req, res) => {
res.sendFile(path.join(__dirname + '/index.html'))
})
app.get('/map2', (req, res) => {
res.sendFile(path.join(__dirname + '/index1.html'))
})
app.get('/map3', (req, res) => {
res.sendFile(path.join(__dirname + '/index2.html'))
})
app.get('/script.js', (req, res) => {
res.sendFile(path.join(__dirname + '/script.js'))
})
app.get('/style.css', (req, res) => {
res.sendFile(path.join(__dirname + '/style.css'))
})
app.get('/StyleSheet.css', (req, res) => {
res.sendFile(path.join(__dirname + '/src/Stony/StyleSheet.css'))
})
app.get('/findWater', async (req, res) => {
res.sendFile(path.join(__dirname + "/water.txt"))
})
app.get('/findBin', async (req, res) => {
res.sendFile(path.join(__dirname + "/bin.txt"))
})
app.get('/findWifi', async (req, res) => {
res.sendFile(path.join(__dirname + "/wifi.txt"))
})
const server = http.listen(port, function() {
console.log(`listening on *: ${port}`);
});