This repository was archived by the owner on Aug 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
53 lines (42 loc) · 1.24 KB
/
Copy pathmain.js
File metadata and controls
53 lines (42 loc) · 1.24 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
51
52
53
const express = require('express')
const minifyHTML = require('express-minify-html');
const app = express()
app.use(minifyHTML({
override: true,
exception_url: false,
htmlMinifier: {
removeComments: true,
collapseWhitespace: true,
collapseBooleanAttributes: true,
removeAttributeQuotes: true,
removeEmptyAttributes: true,
minifyJS: true
}
}));
app.set('view engine', 'ejs');
app.use(express.static(__dirname + '/static'));
app.get('/', (req, res) => {
res.render('index', {page: "home"})
})
app.get('/about', (req, res) => {
res.render('index', {page: "about", title : "About"})
})
app.get('/developers', (req, res) => {
res.render('index', {page: "developers", title : "Developers"})
})
app.get('/terms', (req, res) => {
res.render('index', {page: "terms", title : "Terms of Service"})
})
app.get('/addons', (req, res) => {
res.render('index', {page: "building", title : "Addons page"})
})
app.get('/legalandprivacy', (req, res) => {
res.render('index', {page: "building", title : "Legal and Privacy"})
})
app.get('*', (req, res) => {
res.render('index', {page: 'error', title : 'Error'})
})
const port = process.env.PORT || 80;
app.listen(port, () => {
console.log(`http://localhost:${port}`)
})