forked from jkup/mastering-chrome-devtools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
77 lines (63 loc) · 1.62 KB
/
Copy pathserver.js
File metadata and controls
77 lines (63 loc) · 1.62 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
var express = require('express')
//var compression = require('compression')
var app = express()
app.set('view engine', 'pug')
//app.use(compression())
app.use(express.static('public', { maxAge: 86400000 }))
// Home Page
app.get('/', function (req, res) {
res.render('index', {
scripts: ['main.js']
})
})
// Editing Demo
app.get('/editing', function (req, res) {
res.render('editing', {
scripts: ['editing.js']
})
})
// Debugging Demo
app.get('/debugging', function (req, res) {
res.render('debugging', {
scripts: ['debugging.js', 'debugging2.js']
})
})
// Profiling Demo
app.get('/profiling', function (req, res) {
res.render('profiling', {
scripts: ['profiling.js']
})
})
// Timing Demo
app.get('/timing', function (req, res) {
res.render('timing', {
scripts: ['timing.js']
})
})
// Page Jank Demo
app.get('/page-jank', function (req, res) {
res.render('page-jank')
})
// Memory Leaks
app.get('/memory-leaks', function (req, res) {
res.render('memory-leaks/index', {
scripts: ['memory-leaks.js']
})
})
app.get('/memory-leaks/accidental-globals', function (req, res) {
res.render('memory-leaks/accidental-globals', {
scripts: ['accidental-globals.js']
})
})
app.get('/memory-leaks/callbacks-and-timers', function (req, res) {
res.render('memory-leaks/callbacks-and-timers')
})
app.get('/memory-leaks/forgotten-dom', function (req, res) {
res.render('memory-leaks/forgotten-dom')
})
app.get('/memory-leaks/closures', function (req, res) {
res.render('memory-leaks/closures')
})
app.listen(3000, function () {
console.log('Example app listening on port http://localhost:3000')
})