# hapijs/hapi

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/hapijs-hapi).**

14,789 stars · 1,358 forks · JavaScript · NOASSERTION

## Links

- GitHub: https://github.com/hapijs/hapi
- Homepage: https://hapi.dev
- awesome-repositories: https://awesome-repositories.com/repository/hapijs-hapi.md

## Topics

`application` `framework` `hapi` `http` `nodejs`

## Description

Hapi is a configuration-driven web framework for building secure and scalable HTTP servers and APIs on the Node.js runtime. It functions as a REST API development framework and an enterprise server implementation focused on stability, security, and comprehensive input validation.

The framework is built around a plugin-based architecture, allowing core functionality and custom logic to be organized into modular, registerable plugins. It serves as an HTTP request lifecycle manager, enabling the interception and modification of requests through pre-handlers and extensions before they reach the final route handler.

The project provides capabilities for schema-based input validation, strategy-based authentication, and CORS policy configuration. It includes tools for traffic management via resource-limit load shedding and performance optimization through internal method caching. For testing, the system supports in-process request injection to simulate HTTP requests without a live network connection.

## Tags

### Software Engineering & Architecture

- [Plugin-Based Architectures](https://awesome-repositories.com/f/software-engineering-architecture/software-architecture/architectural-patterns/plugin-module-systems/modular-plugin-architectures/plugin-based-architectures.md) — Uses a plugin-based architecture to modularize core functionality and register new routes or methods.
- [Application Plugins](https://awesome-repositories.com/f/software-engineering-architecture/integration-extensibility/extensibility/plugin-architectures/application-plugins.md) — Provides a plugin system to modularize application logic and extend server functionality. ([source](https://github.com/hapijs/hapi/blob/master/API.md))
- [Modular Application Architectures](https://awesome-repositories.com/f/software-engineering-architecture/software-architecture/architectural-patterns/layering-presentation/application-layer-architectures/application-architecture-patterns/modular-application-architectures.md) — Organizes server logic using a modular, plugin-based architecture to manage shared state.
- [Load Shedding](https://awesome-repositories.com/f/software-engineering-architecture/load-shedding.md) — Automatically rejects incoming requests when heap or event loop lag exceed defined system limits.

### Web Development

- [Node.js Server Frameworks](https://awesome-repositories.com/f/web-development/backend-development/web-frameworks/node-js-server-frameworks.md) — Functions as a comprehensive framework for building secure, scalable HTTP servers and APIs on the Node.js runtime.
- [Web Servers](https://awesome-repositories.com/f/web-development/web-servers.md) — Implements a lightweight server for handling HTTP network requests and managing application state. ([source](https://github.com/hapijs/hapi/blob/master/API.md))
- [API Routing](https://awesome-repositories.com/f/web-development/api-routing.md) — Maps HTTP methods and URI paths to specific handler functions for processing API requests. ([source](https://github.com/hapijs/hapi/blob/master/API.md))
- [Configuration-Driven Frameworks](https://awesome-repositories.com/f/web-development/configuration-driven-frameworks.md) — Defines routes, validation schemas, and authentication strategies through declarative configuration objects.
- [Request Data Handling](https://awesome-repositories.com/f/web-development/request-data-handling.md) — Handles incoming request data as memory buffers, readable streams, or temporary files. ([source](https://github.com/hapijs/hapi/blob/master/API.md))
- [Request Lifecycle Hooks](https://awesome-repositories.com/f/web-development/request-lifecycle-hooks.md) — Provides hooks to intercept and modify URLs, methods, or responses at specific stages of the request lifecycle. ([source](https://github.com/hapijs/hapi/blob/master/API.md))
- [Request Pipelines](https://awesome-repositories.com/f/web-development/request-pipelines.md) — Implements a request pipeline that executes pre-handlers and extension points before the final route handler.
- [REST API Frameworks](https://awesome-repositories.com/f/web-development/rest-api-frameworks.md) — Provides a structured system for mapping HTTP routes to handlers with built-in payload processing and input validation.
- [RESTful API Development](https://awesome-repositories.com/f/web-development/restful-api-development.md) — Facilitates REST API development by mapping HTTP routes to handlers with built-in validation.
- [Request-Response Lifecycle Handlers](https://awesome-repositories.com/f/web-development/backend-development/request-response-handling/request-response-lifecycle-handlers.md) — Implements a request-response pipeline that allows intercepting and modifying HTTP traffic through pre-handlers and extensions.
- [Request Simulators](https://awesome-repositories.com/f/web-development/backend-development/web-frameworks/routing-request-handling/http-request-handlers/request-simulators.md) — Enables simulating HTTP requests by bypassing the network layer to test routing logic directly.
- [CORS Policies](https://awesome-repositories.com/f/web-development/cors-policies.md) — Provides built-in configuration for managing Cross-Origin Resource Sharing security headers. ([source](https://github.com/hapijs/hapi/blob/master/API.md))
- [High-Performance HTTP Servers](https://awesome-repositories.com/f/web-development/high-performance-http-servers.md) — Optimizes for high-throughput and low-latency via internal method caching and load management.
- [Pre-handler Sequences](https://awesome-repositories.com/f/web-development/route-handlers/pre-handler-sequences.md) — Executes an ordered sequence of prerequisite operations in serial or parallel before the primary route handler. ([source](https://github.com/hapijs/hapi/blob/master/API.md))
- [Type-Safe Routing](https://awesome-repositories.com/f/web-development/type-safe-routing.md) — Ensures type safety for routes by defining expected shapes for payloads, query parameters, and path variables. ([source](https://github.com/hapijs/hapi/blob/master/typescript.md))

### Security & Cryptography

- [Authentication Strategies](https://awesome-repositories.com/f/security-cryptography/identity-access-management/authentication-strategies.md) — Supports interchangeable authentication strategies to validate user identities across different route access levels.
- [Input Validation Schemas](https://awesome-repositories.com/f/security-cryptography/input-validation-schemas.md) — Enforces data shapes on headers and payloads using schema-based validation before requests reach the handler.
- [API Gateway Security](https://awesome-repositories.com/f/security-cryptography/api-gateway-security.md) — Implements security layers through authentication strategies and CORS policies to protect API resources.

### Data & Databases

- [Method Result Caches](https://awesome-repositories.com/f/data-databases/data-engineering-infrastructure/caching-performance/caching-strategies/query-result-caching/method-result-caches.md) — Caches the results of registered utility functions to avoid redundant data fetching.

### DevOps & Infrastructure

- [Typed Plugin Interfaces](https://awesome-repositories.com/f/devops-infrastructure/release-automation/plugin-extensibility/typed-plugin-interfaces.md) — Enables the creation of server extensions with defined options and API surfaces to ensure plugins remain strongly typed. ([source](https://github.com/hapijs/hapi/blob/master/typescript.md))

### Networking & Communication

- [HTTP Cookie Management](https://awesome-repositories.com/f/networking-communication/http-clients/http-cookie-management.md) — Provides structured manipulation of HTTP cookies to track user sessions across requests. ([source](https://github.com/hapijs/hapi/blob/master/API.md))

### Programming Languages & Runtimes

- [Typed Server Methods](https://awesome-repositories.com/f/programming-languages-runtimes/strongly-typed-languages/typed-server-methods.md) — Provides registered shared functions that return strongly typed values and arguments with built-in caching. ([source](https://github.com/hapijs/hapi/blob/master/typescript.md))

### System Administration & Monitoring

- [Request Load Shedding](https://awesome-repositories.com/f/system-administration-monitoring/resource-usage-limiters/algorithmic-load-limiters/request-load-shedding.md) — Automatically rejects incoming requests when the server exceeds defined heap or event loop limits. ([source](https://github.com/hapijs/hapi/blob/master/API.md))

### Testing & Quality Assurance

- [API Testing](https://awesome-repositories.com/f/testing-quality-assurance/api-network-testing/api-testing.md) — Supports verifying routing logic and API behavior through in-process request injection.
- [Automated Test Suites](https://awesome-repositories.com/f/testing-quality-assurance/automated-test-suites.md) — Enables automated verification of server behavior by simulating HTTP requests without a live network.

### Part of an Awesome List

- [Web Frameworks](https://awesome-repositories.com/f/awesome-lists/devtools/web-frameworks.md) — Framework for building robust applications and services.
