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
500
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
940
gfnork node.js workshop Lesson #2 JavaScript Async
freundschaft
0
940
gfnork node.js workshop Lesson #3 node.js basics
freundschaft
0
460
gfnork node.js workshop Lesson #5 node.js databases
freundschaft
0
470
gfnork node.js workshop Lesson #6 Unit testing
freundschaft
0
460
Other Decks in Programming
See All in Programming
JSONataを使ってみよう Step Functionsが楽しくなる実践テクニック #devio2025
dafujii
1
530
ProxyによるWindow間RPC機構の構築
syumai
3
1.2k
機能追加とリーダー業務の類似性
rinchoku
2
1.3k
CJK and Unicode From a PHP Committer
youkidearitai
PRO
0
110
Ruby×iOSアプリ開発 ~共に歩んだエコシステムの物語~
temoki
0
320
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
390
デザイナーが Androidエンジニアに 挑戦してみた
874wokiite
0
490
テストカバレッジ100%を10年続けて得られた学びと品質
mottyzzz
2
600
モバイルアプリからWebへの横展開を加速した話_Claude_Code_実践術.pdf
kazuyasakamoto
0
330
print("Hello, World")
eddie
2
530
Ruby Parser progress report 2025
yui_knk
1
450
AI Coding Agentのセキュリティリスク:PRの自己承認とメルカリの対策
s3h
0
230
Featured
See All Featured
How STYLIGHT went responsive
nonsquared
100
5.8k
Designing for Performance
lara
610
69k
Building an army of robots
kneath
306
46k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.5k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.4k
Rails Girls Zürich Keynote
gr2m
95
14k
Speed Design
sergeychernyshev
32
1.1k
Done Done
chrislema
185
16k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Music & Morning Musume
bryan
46
6.8k
Building Applications with DynamoDB
mza
96
6.6k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
530
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