forked from cyclic-software/starter-express-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
63 lines (50 loc) · 1.58 KB
/
index.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// const compression = require('compression')
const express = require('express')
const app = express()
const port = 5000
// app.use(compression());
// Static Files
app.use(express.static('public'));
// Specific folder example
app.use('/css', express.static(__dirname + 'public/css'))
app.use('/js', express.static(__dirname + 'public/js'))
app.use('/img', express.static(__dirname + 'public/images'))
app.use('/fonts', express.static(__dirname + 'public/fonts'))
// Set View's
app.set('views', './views');
app.set('view engine', 'ejs');
// Navigation
app.get('/', (req, res) => {
res.render('index', { text: 'Hey' })
})
app.get('/events', (req, res) => {
res.sendFile(__dirname + '/views/events.html')
})
app.get('/sponsors', (req, res) => {
res.sendFile(__dirname + '/views/coming-soon.html')
})
app.get('/coming', (req, res) => {
res.sendFile(__dirname + '/views/coming.html')
})
app.get('/registration', (req, res) => {
res.sendFile(__dirname + '/views/register.html')
})
app.get('/team', (req, res) => {
res.sendFile(__dirname + '/views/team.html')
})
// app.get('/ContactUs', (req, res) => {
// res.sendFile(__dirname + '/views/team.html')
// })
// app.get('/TechExpo', (req, res) => {
// res.sendFile(__dirname + '/views/tech.html')
// })
// app.get('/ReachUs', (req, res) => {
// res.sendFile(__dirname + '/views/reachus.html')
// })
// app.get('/CAportal', (req, res) => {
// res.sendFile(__dirname + '/views/caportal.html')
// })
// app.get('/Register', (req, res) => {
// res.sendFile(__dirname + '/views/caform.html')
// })
app.listen(process.env.PORT || 3000)