Skip to content

Commit 03345e1

Browse files
author
John Jardin
committed
Included src code for Baseline Performance Testing video demo
1 parent bc033be commit 03345e1

File tree

6 files changed

+468
-5
lines changed

6 files changed

+468
-5
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
'use strict'
2+
3+
require('dotenv').config()
4+
5+
const Express = require('express')
6+
const App = Express()
7+
const HTTP = require('http')
8+
9+
// Router Setup
10+
App.get('/', (req, res) => {
11+
res.send('')
12+
})
13+
14+
// Server Setup
15+
const port = process.env.PORT
16+
const server = HTTP.createServer(App)
17+
18+
server.listen(port, () => {
19+
console.log('NodeJS Performance Optimizations listening on: ', port)
20+
})
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
'use strict'
2+
3+
require('dotenv').config()
4+
5+
const Express = require('express')
6+
const Helmet = require('helmet')
7+
const App = Express()
8+
const HTTP = require('http')
9+
10+
// Express Middleware
11+
App.use(Helmet())
12+
13+
// Router Setup
14+
App.get('/', (req, res) => {
15+
res.send('')
16+
})
17+
18+
// Server Setup
19+
const port = process.env.PORT
20+
const server = HTTP.createServer(App)
21+
22+
server.listen(port, () => {
23+
console.log('NodeJS Performance Optimizations listening on: ', port)
24+
})
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
'use strict'
2+
3+
require('dotenv').config()
4+
5+
const Express = require('express')
6+
const Helmet = require('helmet')
7+
const Morgan = require('morgan')
8+
const App = Express()
9+
const HTTP = require('http')
10+
11+
// Express Middleware
12+
App.use(Helmet())
13+
App.use(Morgan('combined'))
14+
15+
// App.use(Morgan('combined', {
16+
// skip: (req, res) => { return res.statusCode < 400 }
17+
// }))
18+
19+
// Router Setup
20+
App.get('/', (req, res) => {
21+
res.send('')
22+
})
23+
24+
// Server Setup
25+
const port = process.env.PORT
26+
const server = HTTP.createServer(App)
27+
28+
server.listen(port, () => {
29+
console.log('NodeJS Performance Optimizations listening on: ', port)
30+
})

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
- [Project Resources](#table-of-contents)
1717
- [Testing The Event Loop Phases](#testing-the-event-loop-phases)
1818
- [What Type Of Async Function Am I Running](#what-type-of-async-function-am-i-running)
19+
- [How To Determine Application Baseline Performance In Node JS](#how-to-determine-application-baseline-performance-in-node-js)
1920
- [Contributing](#contributing)
2021
- [Links](#links)
2122
- [License](#license)
@@ -28,10 +29,14 @@
2829

2930
## What Type Of Async Function Am I Running
3031

31-
- Watch [YouTube Video](https://youtu.be/ol56smloW2Q)
32-
- Read [Blog Post](http://bleedingcode.com/managing-the-event-loop-phases/)
32+
- Watch [YouTube Video](https://youtu.be/yiBLmRRRx-k)
3333
- Source Code Folder: [02-async-hooks-types-of-async-functions](/02-async-hooks-types-of-async-functions)
3434

35+
## How To Determine Application Baseline Performance In Node JS
36+
37+
- Watch [YouTube Video](https://youtu.be/ol56smloW2Q)
38+
- Source Code Folder: [03-app-baseline-performance](/03-app-baseline-performance)
39+
3540
## Contributing
3641

3742
1. Fork it (<https://github.com/bleedingcode/nodejs-performance-optimizations/fork>)

0 commit comments

Comments
 (0)