-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.js
39 lines (31 loc) · 940 Bytes
/
app.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
// imports
const express = require('express');
const app = express();
const port = 8080;
const HOST = '0.0.0.0';
// Static files
app.use(express.static('public'));
app.use(express.json());
app.use('/css', express.static(__dirname + 'public/css'))
app.use('/js', express.static(__dirname + 'public/js'))
// Views
app.set('views', './views');
app.set('view engine', 'ejs');
app.get('', (req, res) => {
res.render('clientSatisfactionHome');
})
app.get('/csFeedback', (req, res) => {
res.render('csFeedback');
})
app.get('/csFollowUp', (req, res) => {
res.render('csFollowUp');
})
app.get('/csSetReminder', (req, res) => {
res.render('csSetReminder');
})
app.post('/', (req, res) => {
console.log(req.body);
});
// listen to port 8080
app.listen(port, () => console.info(`Server started, running on https://${HOST}:${port}`));
// changed package.json .. the entry point was specified as index.js changed it to app.js