-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
28 lines (24 loc) · 703 Bytes
/
app.js
File metadata and controls
28 lines (24 loc) · 703 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
const express = require('express')
const app = express()
const port = 3000
app.use(express.static('public'))
app.get('/Home', (req, res) => {
// res.send('Hello home!')
res.sendFile(__dirname + '/home.html')
})
app.get('/About', (req, res) => {
// res.send('Hello about us!')
res.sendFile(__dirname + '/about.html')
})
app.get('/Contact', (req, res) => {
// res.send('Hello contact!')
res.sendFile(__dirname + '/contact.html')
})
app.get('*', (req, res) => {
// res.send('Hello contact!')
res.sendFile("404")
})
app.listen(port, () => {
console.log(`Example app listening on port ${port}`)
console.log(`http://127.0.0.1:${port}`)
})