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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
gfnork
June 20, 2014
Programming
0
520
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
520
gfnork node.js workshop Lesson #1 JavaScript Basics
freundschaft
0
970
gfnork node.js workshop Lesson #2 JavaScript Async
freundschaft
0
970
gfnork node.js workshop Lesson #3 node.js basics
freundschaft
0
470
gfnork node.js workshop Lesson #5 node.js databases
freundschaft
0
480
gfnork node.js workshop Lesson #6 Unit testing
freundschaft
0
460
Other Decks in Programming
See All in Programming
Rで始めるML・LLM活用入門
wakamatsu_takumu
0
190
20260313 - Grafana & Friends Taipei #1 - Kubernetes v1.36 的開發雜記:那些困在 Alpha 加護病房太久的 Metrics
tico88612
0
220
ふつうの Rubyist、ちいさなデバイス、大きな一年
bash0c7
0
1k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
650
安いハードウェアでVulkan
fadis
0
460
AI時代のソフトウェア開発でも「人が仕様を書く」から始めよう-医療IT現場での実践とこれから
koukimiura
0
150
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
300
「接続」—パフォーマンスチューニングの最後の一手 〜点と点を結ぶ、その一瞬のために〜
kentaroutakeda
1
440
今からFlash開発できるわけないじゃん、ムリムリ! (※ムリじゃなかった!?)
arkw
0
110
Claude Code Skill入門
mayahoney
0
400
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
290
Claude Codeログ基盤の構築
giginet
PRO
7
3.4k
Featured
See All Featured
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
230
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
Thoughts on Productivity
jonyablonski
75
5.1k
Technical Leadership for Architectural Decision Making
baasie
3
290
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
88
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Fireside Chat
paigeccino
42
3.8k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
310
Art, The Web, and Tiny UX
lynnandtonic
304
21k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
990
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
180
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