Skip to content

Latest commit

 

History

History
50 lines (45 loc) · 2.63 KB

README.md

File metadata and controls

50 lines (45 loc) · 2.63 KB

hapi-of-the-world

Stateless ES7 style Hapi restful API Server sample

Dependencies

aguid
babel
bcrypt
bluebird
boom
catbox-redis
code
eslint
good
good-winston-reporter
hapi
hapi-auth-jwt2
hapi-authorization
hapi-swagger
inert
hapi
joi-objectid
jsonwebtoken
lab
lodash
mongoose
redis
vision
winston

How to start

git clone https://github.com/raymondsze/hapi-of-the-world
operate mongodb in localhost:27017 (could change from config/default/database.js)
operate redis in localhost:6379 (could change from config/default/server.js)
npm install
node ./server.js

go to browser, swagger is pluged, you can visit localhost:8080/documentation

FAQ

Is this still developing?

Yes, many TODOs in my mind, will update here if I have spare time.

  1. Add Like/Vote system to document, try use MQ to handle traffic
  2. Build separate frontend(server view) server to handle server side rendering for React view.
  3. Use React and Redux with Semantic UI to build single page website (frontend)
  4. Testcases with Lab and Code

Why need to put authorization header everytime?

I would like to make completely stateless restful api server.
Without session validation, we could make mobile and web using the same api without concern of CSRF attack. If I understand wrong, please kindly tell me.