SlideShare a Scribd company logo
Comparison NodeJS
frameworks
ladislav@prskavec.net
@abtris
www.praguejs.cz
@jsconfcz
Comparison nodejs frameworks using Polls API
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

More Related Content

What's hot (20)

PDF
What's new in Ansible 2.0
Allan Denot
 
PPTX
Using Cerberus and PySpark to validate semi-structured datasets
Bartosz Konieczny
 
PDF
openstack源码分析(1)
cannium
 
PDF
[Kotlin Serverless 工作坊] 單元 3 - 實作 JSON API
Shengyou Fan
 
PDF
Using zone.js
Standa Opichal
 
PDF
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
Aman Kohli
 
PPTX
Elk with Openstack
Arun prasath
 
PDF
KrakenJS
PayPal
 
PDF
Developing Terraform Modules at Scale - HashiTalks 2021
TomStraub5
 
ODP
Using Logstash, elasticsearch & kibana
Alejandro E Brito Monedero
 
PDF
Python in the database
pybcn
 
PDF
Infrastructure as code terraformujeme cloud
ViliamPucik
 
PPT
AsyncIO To Speed Up Your Crawler
Linggar Primahastoko
 
PDF
Docker Monitoring Webinar
Sematext Group, Inc.
 
PPTX
Terraform day02
Gourav Varma
 
PPTX
Apache Spark Structured Streaming + Apache Kafka = ♡
Bartosz Konieczny
 
PDF
Altitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, Ever
Fastly
 
PDF
WebCamp 2016: DevOps. Ярослав Погребняк: Gobetween - новый лоад балансер для ...
WebCamp
 
PDF
Altitude NY 2018: Programming the edge workshop
Fastly
 
PDF
Automating Workflows for Analytics Pipelines
Sadayuki Furuhashi
 
What's new in Ansible 2.0
Allan Denot
 
Using Cerberus and PySpark to validate semi-structured datasets
Bartosz Konieczny
 
openstack源码分析(1)
cannium
 
[Kotlin Serverless 工作坊] 單元 3 - 實作 JSON API
Shengyou Fan
 
Using zone.js
Standa Opichal
 
DSLing your System For Scalability Testing Using Gatling - Dublin Scala User ...
Aman Kohli
 
Elk with Openstack
Arun prasath
 
KrakenJS
PayPal
 
Developing Terraform Modules at Scale - HashiTalks 2021
TomStraub5
 
Using Logstash, elasticsearch & kibana
Alejandro E Brito Monedero
 
Python in the database
pybcn
 
Infrastructure as code terraformujeme cloud
ViliamPucik
 
AsyncIO To Speed Up Your Crawler
Linggar Primahastoko
 
Docker Monitoring Webinar
Sematext Group, Inc.
 
Terraform day02
Gourav Varma
 
Apache Spark Structured Streaming + Apache Kafka = ♡
Bartosz Konieczny
 
Altitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, Ever
Fastly
 
WebCamp 2016: DevOps. Ярослав Погребняк: Gobetween - новый лоад балансер для ...
WebCamp
 
Altitude NY 2018: Programming the edge workshop
Fastly
 
Automating Workflows for Analytics Pipelines
Sadayuki Furuhashi
 

Viewers also liked (7)

DOCX
RESUME SAMI RASSAS
Rouma Dupeuple
 
PPT
Biogeografia apresentar
Joel Carvalho
 
PDF
OpenNebula Interoperability
dmamolina
 
PDF
Using hapi plugins to version your API (hapiDays 2014)
Dave Stevens
 
PDF
How to Write Big Apps (Richard Rodger NodeDublin 2012)
Richard Rodger
 
PPTX
An Introduction to hapi.js
Dave Stevens
 
PPTX
Building an API in Node with HapiJS
Loc Nguyen
 
RESUME SAMI RASSAS
Rouma Dupeuple
 
Biogeografia apresentar
Joel Carvalho
 
OpenNebula Interoperability
dmamolina
 
Using hapi plugins to version your API (hapiDays 2014)
Dave Stevens
 
How to Write Big Apps (Richard Rodger NodeDublin 2012)
Richard Rodger
 
An Introduction to hapi.js
Dave Stevens
 
Building an API in Node with HapiJS
Loc Nguyen
 
Ad

Similar to Comparison nodejs frameworks using Polls API (20)

KEY
Writing robust Node.js applications
Tom Croucher
 
PPTX
Building Web Apps with Express
Aaron Stannard
 
PDF
Future Decoded - Node.js per sviluppatori .NET
Gianluca Carucci
 
KEY
How and why i roll my own node.js framework
Ben Lin
 
PDF
Build web application by express
Shawn Meng
 
PPT
JS everywhere 2011
Oleg Podsechin
 
PPTX
NodeJS
Alok Guha
 
PPTX
Express js
Manav Prasad
 
PDF
Node js introduction
Alex Su
 
PPT
Владимир Мигуро "Дао Node.js"
EPAM Systems
 
PPT
RESTful API In Node Js using Express
Jeetendra singh
 
PPT
nodejs tutorial foor free download from academia
rani marri
 
PDF
Scala45 spray test
kopiczko
 
PDF
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
scalaconfjp
 
PDF
Xitrum @ Scala Matsuri Tokyo 2014
Ngoc Dao
 
PPT
Server side JavaScript: going all the way
Oleg Podsechin
 
PDF
Bonnes pratiques de développement avec Node js
Francois Zaninotto
 
PDF
Jaap : node, npm & grunt
Bertrand Chevrier
 
PPT
RingoJS
Oleg Podsechin
 
PDF
Node.js - async for the rest of us.
Mike Brevoort
 
Writing robust Node.js applications
Tom Croucher
 
Building Web Apps with Express
Aaron Stannard
 
Future Decoded - Node.js per sviluppatori .NET
Gianluca Carucci
 
How and why i roll my own node.js framework
Ben Lin
 
Build web application by express
Shawn Meng
 
JS everywhere 2011
Oleg Podsechin
 
NodeJS
Alok Guha
 
Express js
Manav Prasad
 
Node js introduction
Alex Su
 
Владимир Мигуро "Дао Node.js"
EPAM Systems
 
RESTful API In Node Js using Express
Jeetendra singh
 
nodejs tutorial foor free download from academia
rani marri
 
Scala45 spray test
kopiczko
 
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
scalaconfjp
 
Xitrum @ Scala Matsuri Tokyo 2014
Ngoc Dao
 
Server side JavaScript: going all the way
Oleg Podsechin
 
Bonnes pratiques de développement avec Node js
Francois Zaninotto
 
Jaap : node, npm & grunt
Bertrand Chevrier
 
Node.js - async for the rest of us.
Mike Brevoort
 
Ad

More from Ladislav Prskavec (20)

PDF
SRE in Apiary
Ladislav Prskavec
 
PDF
Modern Web Architecture<br>based on JS, API and Markup
Ladislav Prskavec
 
PDF
How you can kill Wordpress!
Ladislav Prskavec
 
PDF
SRE in Startup
Ladislav Prskavec
 
PDF
CI and CD
Ladislav Prskavec
 
PDF
Datascript: Serverless Architetecture
Ladislav Prskavec
 
PDF
Serverless Architecture
Ladislav Prskavec
 
PDF
CI and CD
Ladislav Prskavec
 
PDF
PragueJS meetups 30th anniversary
Ladislav Prskavec
 
PDF
How to easy deploy app into any cloud
Ladislav Prskavec
 
PDF
Docker - modern platform for developement and operations
Ladislav Prskavec
 
PDF
GDGSCL - Docker a jeho provoz v Heroku a AWS
Ladislav Prskavec
 
PDF
AWS Elastic Container Service
Ladislav Prskavec
 
PDF
Docker Elastic Beanstalk
Ladislav Prskavec
 
PDF
Docker včera, dnes a zítra
Ladislav Prskavec
 
PDF
Tessel is a microcontroller that runs JavaScript.
Ladislav Prskavec
 
PDF
Docker.io
Ladislav Prskavec
 
PDF
Docker.io
Ladislav Prskavec
 
PDF
AngularJS
Ladislav Prskavec
 
PDF
Firebase and AngularJS
Ladislav Prskavec
 
SRE in Apiary
Ladislav Prskavec
 
Modern Web Architecture<br>based on JS, API and Markup
Ladislav Prskavec
 
How you can kill Wordpress!
Ladislav Prskavec
 
SRE in Startup
Ladislav Prskavec
 
Datascript: Serverless Architetecture
Ladislav Prskavec
 
Serverless Architecture
Ladislav Prskavec
 
PragueJS meetups 30th anniversary
Ladislav Prskavec
 
How to easy deploy app into any cloud
Ladislav Prskavec
 
Docker - modern platform for developement and operations
Ladislav Prskavec
 
GDGSCL - Docker a jeho provoz v Heroku a AWS
Ladislav Prskavec
 
AWS Elastic Container Service
Ladislav Prskavec
 
Docker Elastic Beanstalk
Ladislav Prskavec
 
Docker včera, dnes a zítra
Ladislav Prskavec
 
Tessel is a microcontroller that runs JavaScript.
Ladislav Prskavec
 
Firebase and AngularJS
Ladislav Prskavec
 

Recently uploaded (20)

PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
Complete Network Protection with Real-Time Security
L4RGINDIA
 
PDF
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
PDF
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Complete Network Protection with Real-Time Security
L4RGINDIA
 
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 

Comparison nodejs frameworks using Polls API