Skip to content
This repository has been archived by the owner on Jul 7, 2020. It is now read-only.

minibugdev/hapi-postgres-example

Repository files navigation

Hapi and PostgreSQL example

Getting Start

0. Clone this project

1. Install PostgreSQL and start it.

2. Install node package with

npm install

3. Copy .env.example rename to .env for config project environment

DB_HOST=127.0.0.1
DB_USER=root
DB_PASS=password
DB_NAME=postgres
JWT_SECRET={YOUR JWT SECRET KEY}
JWT_ALGORITHM=HS256

4. Install knex cli

npm install -g knex

4.1. Create users table by

knex migrate:latest            

4.2 If you need starter data, can run

knex seed:run           

5. Start project

npm start

Dependencies

  • Hapi.js A rich framework for building applications and services.
  • Knex.js A query builder for PostgreSQL and a plethora of other RDBMS.
  • JWT JSON Web Token.

This project base on tutorial from scotch.io.

Releases

No releases published

Packages

No packages published