# oakserver/oak

**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/oakserver-oak).**

5,408 stars · 242 forks · TypeScript · MIT

## Links

- GitHub: https://github.com/oakserver/oak
- Homepage: https://oakserver.org
- awesome-repositories: https://awesome-repositories.com/repository/oakserver-oak.md

## Description

Oak is a cross-runtime HTTP middleware framework and web server designed to operate across Deno, Node.js, Bun, and Cloudflare Workers. It provides a unified system for building APIs and web servers using a sequential chain of middleware functions and a hierarchical routing engine that maps URL paths to handlers via a nested tree structure.

The framework includes a runtime-agnostic serverless adapter that translates diverse cloud provider events into a standard request and response interface. It also features a dedicated WebSocket server implementation for bidirectional real-time communication and a web session manager that utilizes asynchronous cookie signing and persistent storage.

The project covers a broad range of server capabilities, including static file serving, content negotiation, and multipart data parsing. Its security and observability surface includes tools for validating JSON Web Tokens, configuring security headers, logging HTTP traffic, and simulating application requests for testing purposes.

## Tags

### Networking & Communication

- [Middleware-Based Request Pipelines](https://awesome-repositories.com/f/networking-communication/communication-protocols-architectures/request-processing-architectures/request-processing/middleware-based-request-pipelines.md) — Provides a sequential chain of middleware functions that intercept and process incoming HTTP requests and responses.
- [WebSocket Servers](https://awesome-repositories.com/f/networking-communication/distributed-systems-p2p/distributed-computing/communication-protocols/websocket-implementations/websocket-servers.md) — Provides a dedicated server implementation for persistent, bidirectional real-time communication via WebSockets.
- [WebSocket Protocol Upgrades](https://awesome-repositories.com/f/networking-communication/http-2-and-websocket-servers/websocket-protocol-upgrades.md) — Transitions active HTTP connections to the WebSocket protocol for continuous bidirectional communication. ([source](https://cdn.jsdelivr.net/gh/oakserver/oak@main/README.md))
- [Real-time Communication](https://awesome-repositories.com/f/networking-communication/real-time-communication.md) — Supports real-time bidirectional communication via WebSocket channels and server-sent events.
- [Server-Sent Events](https://awesome-repositories.com/f/networking-communication/server-sent-events.md) — Maintains open HTTP connections to push real-time data updates to clients via server-sent event streams. ([source](https://cdn.jsdelivr.net/gh/oakserver/oak@main/README.md))

### Web Development

- [Cross-Runtime Web Servers](https://awesome-repositories.com/f/web-development/cross-runtime-web-servers.md) — Provides a unified web server implementation that operates across Deno, Node.js, Bun, and Cloudflare Workers.
- [HTTP Servers](https://awesome-repositories.com/f/web-development/http-servers.md) — Implements a cross-runtime web server compatible with Deno, Node.js, Bun, and Cloudflare Workers. ([source](https://cdn.jsdelivr.net/gh/oakserver/oak@main/README.md))
- [HTTP Request Handling](https://awesome-repositories.com/f/web-development/backend-development/request-response-handling/http-request-handling.md) — Processes incoming network traffic through a structured sequence of handlers to generate client responses. ([source](https://oakserver.github.io/oak/))
- [Path-Based Handler Routings](https://awesome-repositories.com/f/web-development/backend-development/web-frameworks/routing-request-handling/http-request-handlers/path-based-handler-routings.md) — Maps specific URL paths to handler functions using a hierarchical system of nested routing rules. ([source](https://cdn.jsdelivr.net/gh/oakserver/oak@main/README.md))
- [Middleware Frameworks](https://awesome-repositories.com/f/web-development/middleware-frameworks.md) — Provides a framework for processing HTTP requests through modular handlers across multiple JavaScript runtimes.
- [Environment Runtime Adapters](https://awesome-repositories.com/f/web-development/request-adapters/environment-runtime-adapters.md) — Provides adapters that map various runtime-specific network events into standard Web API request and response objects.
- [HTTP Middleware Pipelines](https://awesome-repositories.com/f/web-development/request-middleware-pipelines/http-middleware-pipelines.md) — Provides a sequential chain of middleware functions to process and transform incoming HTTP requests.
- [HTTP Routing](https://awesome-repositories.com/f/web-development/routing-systems/http-routing.md) — Ships a hierarchical routing system for directing incoming HTTP traffic to specific handlers based on paths.
- [Hierarchical Routing](https://awesome-repositories.com/f/web-development/url-generators/url-path-formatters/file-path-to-url-converters/path-based-routing/hierarchical-routing.md) — Implements a hierarchical routing engine that maps URL paths to handlers via a nested tree structure.
- [URL Routing Engines](https://awesome-repositories.com/f/web-development/url-routing-engines.md) — Implements a routing engine that maps URL paths to handlers using a nested tree structure.
- [Execution Error Interception](https://awesome-repositories.com/f/web-development/backend-development/request-response-handling/execution-error-interception.md) — Includes middleware that intercepts uncaught exceptions during the request pipeline to provide centralized error responses.
- [Session State Management](https://awesome-repositories.com/f/web-development/session-state-management.md) — Manages persistent user state across multiple requests using external storage engines and secure cookies. ([source](https://oakserver.github.io/awesome-oak/))
- [Static Asset Serving](https://awesome-repositories.com/f/web-development/web-infrastructure-deployment/web-server-capabilities/static-asset-serving.md) — Delivers assets from the local filesystem while managing browser caching and content headers.
- [Filesystem Static File Servings](https://awesome-repositories.com/f/web-development/web-infrastructure-deployment/web-server-capabilities/static-asset-serving/filesystem-static-file-servings.md) — Implements stream-based delivery of static files directly from the local filesystem to the client. ([source](https://cdn.jsdelivr.net/gh/oakserver/oak@main/README.md))

### DevOps & Infrastructure

- [Handler Route Mapping](https://awesome-repositories.com/f/devops-infrastructure/rest-api-endpoint-management/handler-route-mapping.md) — Features a hierarchical routing engine that maps URL paths to handlers using a nested tree structure.
- [Edge Network Deployment](https://awesome-repositories.com/f/devops-infrastructure/edge-network-deployment.md) — Runs standardized web logic on edge environments by adapting cloud provider events into request objects.
- [Runtime Adapters](https://awesome-repositories.com/f/devops-infrastructure/runtime-agnostic-deployment-tools/runtime-adapters.md) — Includes a translation layer that maps cloud provider events into a unified request and response interface.
- [Serverless Adapters](https://awesome-repositories.com/f/devops-infrastructure/serverless-adapters.md) — Provides compatibility layers for deploying backend logic across diverse serverless runtime environments.

### Part of an Awesome List

- [Real-Time WebSocket Servers](https://awesome-repositories.com/f/awesome-lists/devtools/websockets-and-real-time/real-time-websocket-servers.md) — Implements a dedicated WebSocket server to facilitate bidirectional, real-time communication channels. ([source](https://oakserver.github.io/awesome-oak/))
- [Web Frameworks](https://awesome-repositories.com/f/awesome-lists/devtools/web-frameworks.md) — A middleware framework for Deno's net server.

### Security & Cryptography

- [Cookie Signing Utilities](https://awesome-repositories.com/f/security-cryptography/cookie-security/cookie-signing-utilities.md) — Implements cryptographic signing for cookies to ensure session data integrity and prevent client-side tampering.
- [Web Session Management](https://awesome-repositories.com/f/security-cryptography/web-session-management.md) — Handles user authentication and persistent state through secure cookies and session storage.

### Software Engineering & Architecture

- [Error Handling Middleware](https://awesome-repositories.com/f/software-engineering-architecture/error-handling-middleware.md) — Includes middleware that intercepts uncaught exceptions in the request pipeline to provide centralized error responses. ([source](https://cdn.jsdelivr.net/gh/oakserver/oak@main/README.md))
- [Request Context State](https://awesome-repositories.com/f/software-engineering-architecture/request-context-state.md) — Uses a request-scoped context object to share state and data between middleware and final request handlers.
- [Standardized Event Mapping](https://awesome-repositories.com/f/software-engineering-architecture/standardized-event-mapping.md) — Translates diverse cloud provider events into a unified request and response interface for serverless environments. ([source](https://oakserver.github.io/awesome-oak/))
