Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
gfnork node.js workshop Lesson #4 middleware fo...
Search
gfnork
June 20, 2014
Programming
0
490
gfnork node.js workshop Lesson #4 middleware for node
connect.js, express.js and other fun things
gfnork
June 20, 2014
Tweet
Share
More Decks by gfnork
See All by gfnork
Basic Mobile Application Design
freundschaft
0
500
gfnork node.js workshop Lesson #1 JavaScript Basics
freundschaft
0
930
gfnork node.js workshop Lesson #2 JavaScript Async
freundschaft
0
930
gfnork node.js workshop Lesson #3 node.js basics
freundschaft
0
460
gfnork node.js workshop Lesson #5 node.js databases
freundschaft
0
460
gfnork node.js workshop Lesson #6 Unit testing
freundschaft
0
450
Other Decks in Programming
See All in Programming
Is Xcode slowly dying out in 2025?
uetyo
1
240
エラーって何種類あるの?
kajitack
5
330
AIエージェントはこう育てる - GitHub Copilot Agentとチームの共進化サイクル
koboriakira
0
480
アンドパッドの Go 勉強会「 gopher 会」とその内容の紹介
andpad
0
280
Systèmes distribués, pour le meilleur et pour le pire - BreizhCamp 2025 - Conférence
slecache
0
120
datadog dash 2025 LLM observability for reliability and stability
ivry_presentationmaterials
0
400
AIプログラマーDevinは PHPerの夢を見るか?
shinyasaita
1
180
#QiitaBash MCPのセキュリティ
ryosukedtomita
0
610
5つのアンチパターンから学ぶLT設計
narihara
1
140
ペアプロ × 生成AI 現場での実践と課題について / generative-ai-in-pair-programming
codmoninc
0
230
VS Code Update for GitHub Copilot
74th
1
540
エンジニア向け採用ピッチ資料
inusan
0
180
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
234
140k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.8k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
107
19k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Speed Design
sergeychernyshev
32
1k
Faster Mobile Websites
deanohume
307
31k
The Cult of Friendly URLs
andyhume
79
6.5k
Designing Experiences People Love
moore
142
24k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Visualization
eitanlees
146
16k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
Transcript
None
2
3
4 var app = connect() .use(connect.logger('dev')) .use(connect.static('public')) .use(function (req, res)
{ res.end('hello world\n'); }) http.createServer(app).listen(3000);
5 function SampleMiddleware(req, res, next) { next(); }
6
7
8 var http = require('http'); http.createServer(function (req, res) { res.writeHead(200,
{ 'Content-Type': 'text/plain' }); res.end('Hello World\n'); }).listen(1337, '127.0.0.1'); console.log('Server running at http://127.0.0.1:1337/');
9 var http = require('http'); http.createServer(function (req, res) { res.writeHead(200,
{ 'Content-Type': 'text/plain' }); res.end('Hello World\n'); }).listen(1337, '127.0.0.1'); console.log('Server running at http://127.0.0.1:1337/'); var express = require('express'); var app = express(); app.get('/', function (req, res) { res.send('hello world'); }); app.listen(3000);
10 e.g. http://examplewebsite/customers/showall http://examplewebsite/customers/add http://examplewebsite/customers/delete
11
12 https://github.com/visionmedia/consolidate.js app.engine('jade', require('jade').__express); app.set('view engine', 'jade');
13 res.render('email', { name: 'Tobi' }, function (err, html) {
// ... });
14
15
16
17