Demo of creating Restful API with Hapi.js including some features, such as joi, boom, good, swagger, sequelize, sqlite, json web token authentication.
node >= 8.9.0
clone this repo, then
npm init
- Node - Javascript run-time environment
- Hapi.js - A rich framework for building applications and services
- Boom - HTTP-friendly error objects
- Good - Hapi process monitoring
- Joi - Object schema validation
- Sequelize - Promise-based ORM for Node.js
- Sequelize Fixtures - Load data from file to Sequelize
- Sqlite - In-process library that implements a SQL database engine
- Hapi Swagger - Swagger documentation UI generator plugin
- Json Web Token - Json Web Token
- Hapi Auth JWT2 - Simplified JSON Web Token (JWT) authentication plugin
Just start the application with (npm start
). The application is
running at localhost:3000.
Initial test data is import.yaml
file.
Swagger path is localhost:3000/documentation.
Make http requests via Curl or Postman or Swagger.
Test user
username: hero
password: 123
- Authentication localhost:3000/auth
- Movies localhost:3000/movies
- Movie localhost:3000/movies/{id}