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
510
gfnork node.js workshop Lesson #1 JavaScript Basics
freundschaft
0
960
gfnork node.js workshop Lesson #2 JavaScript Async
freundschaft
0
960
gfnork node.js workshop Lesson #3 node.js basics
freundschaft
0
470
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
Basic Architectures
denyspoltorak
0
680
余白を設計しフロントエンド開発を 加速させる
tsukuha
7
2.1k
Oxlint JS plugins
kazupon
1
970
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
740
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
7.4k
Vibe Coding - AI 驅動的軟體開發
mickyp100
0
180
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
470
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
220
CSC307 Lecture 03
javiergs
PRO
1
490
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
390
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.3k
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
240
Featured
See All Featured
Designing for Timeless Needs
cassininazir
0
130
The Spectacular Lies of Maps
axbom
PRO
1
520
Visualization
eitanlees
150
17k
The Limits of Empathy - UXLibs8
cassininazir
1
220
RailsConf 2023
tenderlove
30
1.3k
Site-Speed That Sticks
csswizardry
13
1.1k
From π to Pie charts
rasagy
0
120
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Testing 201, or: Great Expectations
jmmastey
46
8k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
110
Become a Pro
speakerdeck
PRO
31
5.8k
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