Skip to content

Latest commit

 

History

History
58 lines (39 loc) · 1.4 KB

readme.md

File metadata and controls

58 lines (39 loc) · 1.4 KB

Hapi Node.js API Project

Introduction

This project demonstrates how to create a RESTful API using Hapi.js with Node.js. The API supports basic CRUD operations and includes authentication using JWT (JSON Web Tokens).

Features

  • Hapi.js Framework: Robust and scalable web framework for building APIs.
  • JWT Authentication: Secure user authentication using JSON Web Tokens.
  • CRUD Operations: Basic Create, Read, Update, and Delete functionalities.
  • Error Handling: Graceful error handling using Boom.
  • Data Validation: Request payload validation using Joi.

Prerequisites

  • Node.js: Ensure you have Node.js installed. You can download it from nodejs.org.
  • npm: Node package manager is installed with Node.js.

Installation

  1. Clone the repository:

    git clone https://github.com/khoido2003/Hapi-Nodejs.git
  2. Install Dependencies:

    npm install
  3. Start the Project:

    npm run start

Configuration

Before running the application, you need to set up the configuration variables. Create a .env file in the root directory of the project and add the following variables:

   NODE_ENV=''

  HAPI_PORT=''
  HAPI_HOST=''

  MONGODB_URI=''

  JWT_SECRET=''
  JWT_EXPIRES_IN=''
  JWT_COOKIE_EXPIRES_IN=''

Technologies Used