Skip to content

m-cakir/hapi-playground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hapi.js Playground

Demo of creating Restful API with Hapi.js including some features, such as joi, boom, good, swagger, sequelize, sqlite, json web token authentication.

Prerequisites

node >= 8.9.0

Install

clone this repo, then

npm init

Deployment

Deploy

Built With

  • 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

Usage

Just start the application with (npm start). The application is running at localhost:3000.

alt text

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

Methods

Screenshot

alt text