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
79
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
49
Build nice terminal UI with Bubble Tea
abtris
1
240
How to make own observability solution?
abtris
0
210
OpenTelemetry as best way how to instrument your CICD pipeline
abtris
0
250
Prague Go Meetup #12 Introductions
abtris
0
53
How we run stateful services for customers in Kubernetes
abtris
0
340
Go Release 1.20
abtris
0
200
CI pipelines should be code! Dagger Go SDK
abtris
1
340
Getting started with fuzzing
abtris
0
310
Other Decks in Technology
See All in Technology
webpack依存からの脱却!快適フロントエンド開発をViteで実現する #vuefes
bengo4com
2
2.4k
まだ間に合う! 2025年のhono/ssg事情
watany
0
190
物体検出モデルでシイタケの収穫時期を自動判定してみた。 #devio2025
lamaglama39
0
270
AIとともに歩んでいくデザイナーの役割の変化
lycorptech_jp
PRO
0
810
OSSで50の競合と戦うためにやったこと
yamadashy
3
940
QA業務を変える(!?)AIを併用した不具合分析の実践
ma2ri
0
110
SQLAlchemy の select(User).where(User.id =="123") を理解してみる/sqlalchemy deep dive
3l4l5
2
240
AIエージェント入門 〜基礎からMCP・A2Aまで〜
shukob
1
150
NLPコロキウム20251022_超効率化への挑戦: LLM 1bit量子化のロードマップ
yumaichikawa
1
190
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
3k
From Natural Language to K8s Operations: The MCP Architecture and Practice of kubectl-ai
appleboy
0
110
現場データから見える、開発生産性の変化コード生成AI導入・運用のリアル〜 / Changes in Development Productivity and Operational Challenges Following the Introduction of Code Generation AI
nttcom
1
440
Featured
See All Featured
A Tale of Four Properties
chriscoyier
161
23k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
30
2.9k
Leading Effective Engineering Teams in the AI Era
addyosmani
7
570
Scaling GitHub
holman
463
140k
Building a Scalable Design System with Sketch
lauravandoore
463
33k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Producing Creativity
orderedlist
PRO
347
40k
Balancing Empowerment & Direction
lara
5
700
How GitHub (no longer) Works
holman
315
140k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
190
55k
Fireside Chat
paigeccino
40
3.7k
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