Getting Started

npm init
npm install hapi --save

create an index.js

run

node .

hot reload

開発用, productionでは使えない

install node-dev

npm install -g node-dev

Usage

node-dev foo.js

Plugins & Default functions

Static pages and content

static page view

npm install --save inert

validation

validation by joi

npm install --save joi

log / good, good-console

npm install --save good
npm install --save good-console

Authentication

passport & passport-local

passport

  • Passport is authentication middleware for Node.js
  • A comprehensive set of strategies support authentication using a username and password, Facebook, Twitter, and more
npm install --save passport

hapi authentication

TODO check

others

mongodb

mongoose

boilplate

plugins

https://hapi-plugins.com/

References

results matching ""

    No results matching ""