"...development platform built on top of Google's V8 JavaScript virtual machine. The Node.js libraries are focused on building server-side applications in JavaScript."
v8
"...V8 is the JavaScript execution engine built for Google Chrome and open-sourced by Google in 2008. Written in C++, V8 compiles JavaScript source code to native machine code instead of interpreting it in real time"
the node.js system
confused ?
demonstration
hello world
what problem it solves ?
when use nodejs
Intensive I/O
Web Applications
Chat
Data Streaming
when not use nodejs
Parallel Applications
Heavy Server-side computation / processing
Intensive CPU operations
building apis with hapi.js
hapi.js
demonstration
hapi.js
joi
npm i --save hapi
npm i --save joi
demonstration
hapi.js
jwt
Hapi Auth using JSON Web Tokens (JWT)
Hapi Auth using JSON Web Tokens (JWT)
npm i --save hapi
npm i --save hapi-auth-jwt2 //manage token on hapi lifecycle
npm i --save jsonwebtoken //sign and validation
demonstration
hapi.js
swagger
HAPI SWAGGER
npm i --save hapi
npm i --save joi //object validations
npm i --save inert //Static file and directory handler
npm i --save vision //Templates rendering
npm i --save hapi-swagger //API Documentation