Category: 04. Hapi Js

https://raw.githubusercontent.com/hapijs/assets/master/images/hapi.png

  • Advanced Features

    1. Plugins and Extensions
      • Using built-in plugins for added functionality.
      • Creating custom plugins to extend Hapi.js.
      • Understanding Hapi’s extension points for adding functionality to requests, responses, and lifecycle events.
    2. Validation and Schemas
      • Implementing request validation using Joi (a popular validation library).
      • Defining and applying schemas for request payloads, query parameters, and headers.
    3. Authentication and Authorization
      • Integrating authentication strategies (basic auth, OAuth, etc.).
      • Implementing role-based access control and permissions.
    4. Error Handling
      • Configuring global error handling.
      • Customizing error responses and logging.
    5. Caching
      • Configuring caching mechanisms for improved performance.
      • Understanding Hapi’s built-in caching options.
    6. Testing
      • Writing unit tests for Hapi.js applications.
      • Using testing libraries and tools compatible with Hapi.js.
  • Introduction to Hapi.js

    1. Overview and Philosophy
      • Introduction to Hapi.js: Its history, purpose, and core philosophy.
      • Comparison with other frameworks like Express.js, highlighting unique features of Hapi.js.
    2. Setting Up the Environment
      • Installing Node.js and npm (Node Package Manager).
      • Setting up a Hapi.js project from scratch.
      • Basic structure of a Hapi.js application.

    Core Concepts

    1. Server Creation
      • Creating a Hapi server instance.
      • Understanding server configurations and options.
    2. Routing
      • Defining routes with various HTTP methods (GET, POST, PUT, DELETE).
      • Route handlers: processing requests and sending responses.
      • Route parameters and query strings.
    3. Request and Response Lifecycle
      • Understanding the lifecycle of a request.
      • Accessing request data (headers, payload, parameters).
      • Sending responses and customizing response formats.