Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Foreword
A framework that makes you hapi
Preface
Why use hapi?
What should you know prior to reading this book?
Source code/sample app
What will this book teach you?
Authors
1. Introduction to hapi
History
Book overview
hapi-plugins.com
Style
Summary
2. Server
Setting up a simple server
Setting up the server for hapi-plugins.com
Glue
Rejoice
Confidence
Server methods
Decorating the server
Configuring for caching
Request lifecycle
Extension points
Summary
3. Routes
Path processing
Parts of the route
method
vhost
handler
config
Route prerequisites
path
Simple path
Optional parameters
Wildcards
Server router config options
Summary
4. The handler
The request
parameters
query
payload
headers
The reply
Organizing handlers
Built-in handlers
File
String
Callback
Object
directory
Views handler
Regular handler using server.views
proxy
Adding common methods to the handler
Binding to server
Decorating the reply
Tails
Defining the handler using server.handler
Liking a plugin example
Uploading files
Summary
5. Validation
Types of validations
Joi validation
Validation for hapi-plugins.com
Generic data validation with joi
Using a validation function
Summary
6. Plugins
Creating your own plugin
Plugin configuration
A word on labels and selecting plugins
When to use a plugin
The hapi plugin ecosystem: some common plugins
hapi-auth-basic
blipp
bell
good
tv
lout / hapi-swagger
poop
More plugins
Summary
7. Authentication
Chapter Overview
Scheme vs strategy
hapi-auth-basic
hapi-auth-cookie
bell
Summary
8. Models
Using HTTP
Desired Usage
NPM Packages
NPM Downloads
Plugins Model: Actual Usage
Using a database
Setting up the database
Connecting to the database
Schema Design
Searching plugins
Adding Plugins
Summary
9. Templating
Configuration
Options
Engines
compileMode option
Paths
Global vs Specific
More Options
Starter Examples
View Loading
Layouts
Configuration
Usage
Exclusion
Partials
Configuration
Helpers
Configuration
Helper Files
Shared Contexts
Summary
10. Testing
Chapter Overview
History of lab
Installing lab
Installing code
Writing a simple test
Principles of lab
Always asynchronous
Test scripts
Safe globals
Experiments
Writing a hapi test
Code coverage
Reporters
Linting
Plugin Testing
Summary
11. Debugging
Chapter Overview
console.log
debug mode
TV
Good
REPL
Heap Snapshots
Core Files
Summary
12. Security
Best practices
Password hashing: BCrypt
Solution
XSS
Solution
CSRF
Solution
SSL
Header stripping
clickjacking
Solution
X-Powered-By
Solution
IE open within context
Solution
contentSecurityPolicy
Solution
CORS
Solution
crossdomain.xml
Solution
Summary
Review
13. Appendix
Models
History
Overview of HTTP Clients
History
Wreck
Request
Overview of database clients
MongoDB
mongodb
Mongoose
Cassandra
Apollo
cassandra-driver
Postgres
pg
Sequelize
Connection
MongoDB::mongodb
MongoDB::Mongoose
Cassandra::Apollo
Postgres::pg
Postgres::Sequelize
Schemas
MongoDB::mongodb
MongoDB::Mongoose
Cassandra::Apollo
Templating Engines
Overview of Selected Templating Engines
Mustache.js / Hogan.js
Handlebars.js
Jade
Dust
ECT
← Prev
Back
Next →
← Prev
Back
Next →