koatty_serve is a high-performance single-protocol server framework for Koatty, providing unified HTTP, HTTPS, HTTP/2, HTTP/3 (QUIC), WebSocket, WebSocket Secure, and gRPC server support. Version 3.2.0, released in 2024, features a template method pattern architecture with BaseServer, protocol-specific connection pools, graceful shutdown, health checks, and performance monitoring. It is designed for Node.js 18+ and ships with TypeScript types. Key differentiators include a unified configuration system via ConfigHelper, hot-reload capability, and per-instance single-protocol design.
npm install koatty_serveNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates an HTTP server using the recommended NewServe factory function with basic configuration.
Use separate server instances for each protocol (HTTP, gRPC, WebSocket) instead of a single combined server.
Use NewServe(app, config) instead of constructing server classes directly.
Validate configuration objects against the exported TypeScript types before passing to ConfigHelper or NewServe.
Upgrade Node.js to version 18 or later.
Resolve SSL file paths using path.resolve(__dirname, 'ssl/key.pem') to ensure correct location.
Ensure you have the latest version installed and that your bundler (e.g., webpack, esbuild) supports package exports. For Node.js, use ESM with 'import { ConfigHelper } from 'koatty_serve/config';'Use the ESM import syntax: 'import { NewServe } from 'koatty_serve';'Ensure each server instance uses a unique port. For HTTP and HTTPS, use separate ports or combine them via a reverse proxy.
Add a valid protocol value (e.g., 'http', 'https', 'grpc', 'ws', 'wss', 'http2', 'http3') to the options object.
No dependency data recorded yet.