$30 off During Our Annual Pro Sale. View Details »
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
67
Build nice terminal UI with Bubble Tea
abtris
1
260
How to make own observability solution?
abtris
0
210
OpenTelemetry as best way how to instrument your CICD pipeline
abtris
0
260
Prague Go Meetup #12 Introductions
abtris
0
61
How we run stateful services for customers in Kubernetes
abtris
0
370
Go Release 1.20
abtris
0
210
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
ZOZOの独自性を生み出す「似合う4大要素」の開発サイクル
zozotech
PRO
0
120
JEDAI認定プログラム JEDAI Order 2026 エントリーのご案内 / JEDAI Order 2026 Entry
databricksjapan
0
160
Building Serverless AI Memory with Mastra × AWS
vvatanabe
0
310
20251222_サンフランシスコサバイバル術
ponponmikankan
2
130
シニアソフトウェアエンジニアになるためには
kworkdev
PRO
3
250
AIの長期記憶と短期記憶の違いについてAgentCoreを例に深掘ってみた
yakumo
4
470
【U/Day Tokyo 2025】Cygames流 最新スマートフォンゲームの技術設計 〜『Shadowverse: Worlds Beyond』におけるアーキテクチャ再設計の挑戦~
cygames
PRO
2
1.2k
20251218_AIを活用した開発生産性向上の全社的な取り組みの進め方について / How to proceed with company-wide initiatives to improve development productivity using AI
yayoi_dd
0
610
1人1サービス開発しているチームでのClaudeCodeの使い方
noayaoshiro
2
560
20251219 OpenIDファウンデーション・ジャパン紹介 / OpenID Foundation Japan Intro
oidfj
0
410
アプリにAIを正しく組み込むための アーキテクチャ── 国産LLMの現実と実践
kohju
0
190
AWSに革命を起こすかもしれない新サービス・アップデートについてのお話
yama3133
0
470
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Embracing the Ebb and Flow
colly
88
4.9k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.6k
AI: The stuff that nobody shows you
jnunemaker
PRO
1
6
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
0
70
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
2
61
Paper Plane
katiecoart
PRO
0
44k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Crafting Experiences
bethany
0
21
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
0
240
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
31
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