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
85
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Comparison nodejs frameworks using Polls API
3 NodeJS implementations of Polls API.
All implementations are tested by Dredd.
Ladislav Prskavec
May 23, 2015
More Decks by Ladislav Prskavec
See All by Ladislav Prskavec
Techspresso 2026 - How to make MCP server in Go?
abtris
0
14
Under the Hood of AI - Building Your Own MCP Server in Go
abtris
0
38
From Small Terraform Projects to Terralith
abtris
0
100
Build nice terminal UI with Bubble Tea
abtris
1
340
How to make own observability solution?
abtris
0
250
OpenTelemetry as best way how to instrument your CICD pipeline
abtris
0
310
Prague Go Meetup #12 Introductions
abtris
0
80
How we run stateful services for customers in Kubernetes
abtris
0
440
Go Release 1.20
abtris
0
230
Other Decks in Technology
See All in Technology
「エンジニア進化論」2028年の開発完全自動化、エンジニアはどう進化するか
cyberagentdevelopers
PRO
3
1k
ブロックチェーン / Blockchain
ks91
PRO
0
120
運用を見据えたAIエージェント設計実践
amacbee
1
3.4k
Claude Code×Terraform IaC テンプレート駆動開発
itouhi
1
460
Mastering Ruby Box
tagomoris
3
150
SIer20年! 培ったスキルがスタートアップで輝く時
shucho0103
0
800
中期計画、2回作ってみた ~業務委託と正社員、両方の視点から~
demaecan
1
570
AI Engineering Summit Tokyo 2026 AIの前に、やることがある 〜医療データ企業の4フェーズ〜
dtaniwaki
0
2.4k
エンジニアリング戦略の作り方 / Crafting Engineering Strategy
iwashi86
18
5.7k
やさしいA2A入門
minorun365
PRO
10
1.4k
「嘘をつくテスト」の失敗例から学ぶ 良いテストコード #frontend_phpcon_do
asumikam
0
600
もりもり新機能を一挙紹介! AgentCoreに入門して、AWS上にAIエージェントを構築しよう
minorun365
PRO
6
880
Featured
See All Featured
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
480
The Cult of Friendly URLs
andyhume
79
6.9k
Fireside Chat
paigeccino
42
3.9k
Making Projects Easy
brettharned
120
6.7k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
How to train your dragon (web standard)
notwaldorf
97
6.7k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
220
Code Reviewing Like a Champion
maltzj
528
40k
A Soul's Torment
seathinner
6
2.9k
Git: the NoSQL Database
bkeepers
PRO
432
67k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.5k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
580
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