Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
gfnork node.js workshop Lesson #4 middleware fo...
Search
gfnork
June 20, 2014
Programming
530
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
gfnork node.js workshop Lesson #4 middleware for node
connect.js, express.js and other fun things
gfnork
June 20, 2014
More Decks by gfnork
See All by gfnork
Basic Mobile Application Design
freundschaft
0
540
gfnork node.js workshop Lesson #1 JavaScript Basics
freundschaft
0
990
gfnork node.js workshop Lesson #2 JavaScript Async
freundschaft
0
1k
gfnork node.js workshop Lesson #3 node.js basics
freundschaft
0
480
gfnork node.js workshop Lesson #5 node.js databases
freundschaft
0
490
gfnork node.js workshop Lesson #6 Unit testing
freundschaft
0
480
Other Decks in Programming
See All in Programming
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
430
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
790
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.9k
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
380
機械に任せるテスト、人が見るテスト ⽣成AIで引き直した、運⽤保守フェーズの線引き
dske104
0
190
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.6k
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
210
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
2
590
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
150
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
170
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
170
Vue Fes Japan の “作る側”に関わってみて
naokihaba
0
160
Featured
See All Featured
Technical Leadership for Architectural Decision Making
baasie
3
600
The untapped power of vector embeddings
frankvandijk
2
1.9k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
1
280
The browser strikes back
jonoalderson
0
1.8k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
630
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
What does AI have to do with Human Rights?
axbom
PRO
1
2.5k
Code Review Best Practice
trishagee
74
20k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
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