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
Comparison nodejs frameworks using Polls API
Search
Ladislav Prskavec
May 23, 2015
Technology
0
80
Comparison nodejs frameworks using Polls API
3 NodeJS implementations of Polls API.
All implementations are tested by Dredd.
Ladislav Prskavec
May 23, 2015
Tweet
Share
More Decks by Ladislav Prskavec
See All by Ladislav Prskavec
From Small Terraform Projects to Terralith
abtris
0
76
Build nice terminal UI with Bubble Tea
abtris
1
280
How to make own observability solution?
abtris
0
220
OpenTelemetry as best way how to instrument your CICD pipeline
abtris
0
270
Prague Go Meetup #12 Introductions
abtris
0
65
How we run stateful services for customers in Kubernetes
abtris
0
390
Go Release 1.20
abtris
0
220
CI pipelines should be code! Dagger Go SDK
abtris
1
350
Getting started with fuzzing
abtris
0
330
Other Decks in Technology
See All in Technology
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1k
予期せぬコストの急増を障害のように扱う――「コスト版ポストモーテム」の導入とその後の改善
muziyoshiz
1
1.8k
Agile Leadership Summit Keynote 2026
m_seki
1
580
レガシー共有バッチ基盤への挑戦 - SREドリブンなリアーキテクチャリングの取り組み
tatsukoni
0
210
Bedrock PolicyでAmazon Bedrock Guardrails利用を強制してみた
yuu551
0
200
小さく始めるBCP ― 多プロダクト環境で始める最初の一歩
kekke_n
1
390
データの整合性を保ちたいだけなんだ
shoheimitani
8
3.1k
SREじゃなかった僕らがenablingを通じて「SRE実践者」になるまでのリアル / SRE Kaigi 2026
aeonpeople
6
2.3k
会社紹介資料 / Sansan Company Profile
sansan33
PRO
15
400k
Cosmos World Foundation Model Platform for Physical AI
takmin
0
810
配列に見る bash と zsh の違い
kazzpapa3
1
130
OCI Database Management サービス詳細
oracle4engineer
PRO
1
7.4k
Featured
See All Featured
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
150
Statistics for Hackers
jakevdp
799
230k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.1k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.3k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
580
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
110
Build your cross-platform service in a week with App Engine
jlugia
234
18k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
120
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
56
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
Code Reviewing Like a Champion
maltzj
527
40k
Transcript
Comparison NodeJS frameworks
[email protected]
@abtris www.praguejs.cz @jsconfcz
None
express koa hapi github stars 18861 6174 4228 contributors 178
59 116 downloads / w 525941 8769 11966 stack overflow 14853 138 66 npm -ls | wc -l 48 36 48 file size 3896 2000 50392
http://docs.nodeschoolhk.apiary.io/
https://github.com/apiaryio/dredd
Init server
"express": "^4.12.3" (function() { 'use strict'; var express = require('express');
var app = express(); app.set('json spaces', 2); .... var server = app.listen(3003, function() { var host = server.address().address; var port = server.address().port; console.log('Example app listening at http://%s:%s', host, port); }); }());
"hapi": "^8.4.0" var Hapi = require('hapi'); var server = new
Hapi.Server(); server.connection({port: 3001}); .... // Start the server server.start(function() { console.log('Server running at:', server.info.uri); });
"koa": "^0.20.0" "use strict"; var koa = require('koa'); var route
= require('koa-route'); var app = koa(); require('koa-qs')(app); .... app.listen(3000);
Routing
"express": "^4.12.3" app.get('/questions/:question_id', function(req, res) { res.status(200).json({"question":"Favourite programming language?"...}]}); });
app.post('/questions/:question_id/choices/:choice_id', function(req, res) { res.set('Location', '/questions/' + req.params.question_id); res.status(201).send(''); });
"hapi": "^8.4.0" server.route({ method: 'GET', path: '/questions/{question_id}', handler: function(request, reply)
{ reply({"question":"Favourite programming language?"...}); } }); server.route({ method: 'POST', path: '/questions/{question_id}/choices/{choice_id}', handler: function(request, reply) { reply().code(201).header('Location', '/questions/' + request.params.question_id); } });
"koa": "^0.20.0" app.use(route.get('/questions/:question_id', function *(question_id) { this.body = {"question":"Favourite programming
language?"...}; })); app.use(route.post('/questions/:question_id/choices/:choice_id', function *(question_id, choice_id) { this.status = 201; this.set('Location', '/questions/' + question_id); this.body = ''; }));
Testing • Dredd var hooks = require('hooks'); var before =
hooks.before; hooks.beforeEach(function(transaction) { if (transaction.expected.headers['Content-Type'] == 'application/json') { transaction.expected.headers['Content-Type'] = 'application/json; charset=utf-8'; } });
Github repository of project: https://github.com/abtris/nodeschool-hk-2015-05-23 Ideas how project improve: •
you can fork and contribute • you can try add 404, 500 pages • you can try persistent layer using Redis