forked from cmda-minor-web/human-centered-design-2021
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
43 lines (33 loc) · 971 Bytes
/
Copy pathserver.js
File metadata and controls
43 lines (33 loc) · 971 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const renderNewSight = require('./public/src/routes/newSight')
const express = require('express')
const bodyParser = require('body-parser')
const app = express()
var path = require('path');
const port = process.env.PORT || 3000
//Identifying default path
app.use(express.static(__dirname + '/public/'));
//Templating engine
app.set('views', 'view')
app.set('view engine', 'ejs')
app.use(bodyParser.urlencoded({
extended: true,
}));
app.get('/', (req, res) => {
res.render('index')
})
app.get('/skillfulmeans1', (req, res) => {
res.render('skillfulmeans1')
})
app.get('/skillfulmeans2', (req, res) => {
res.render('skillfulmeans2')
})
app.get('/skillfulmeans3', (req, res) => {
res.render('skillfulmeans3')
})
app.get('/newsight', renderNewSight)
app.get('/test', function(req, res) {
res.sendFile(path.join(__dirname + '/index.html'));
});
app.listen(port, () => {
console.log(`Example app listening at: http://localhost:${port}`)
})