How owl23007/nova-http works
Nova is a lightweight Node.js TCP-based HTTP framework. The main workflow is an application developer configuring an app, which accepts HTTP requests, parses them, dispatches middleware and routes, and returns a response over the connection. Major documented features include sub-apps, lifecycle hooks, streaming with backpressure, body parsing, and static files. The tree and excerpts support the core dispatch and server relationships; the exact internals of some protocol and CLI wiring were not sampled.
Main entry points: application.ts Application · http1-connection.ts Connection coordinator · middleware-chain.ts Middleware chain · index.ts Public API
Components 20
App setup
- Public API
packages/nova-http/src/index.ts - App factory
packages/nova-http/src/app/nova.ts - Project CLI
packages/nova-http/cli/nova.ts - App templates
packages/nova-http/cli/templates
Request runtime
- Application
packages/nova-http/src/core/application.ts - Radix router
packages/nova-http/src/core/router.ts - Middleware chain
packages/nova-http/src/core/middleware-chain.ts - Lifecycle hooks
packages/nova-http/src/core/hooks.ts - Request model
packages/nova-http/src/core/request.ts - Response model
packages/nova-http/src/core/response.ts
HTTP transport
- TCP server
packages/nova-http/src/server/server.ts - Connection coordinator
packages/nova-http/src/server/http1-connection.ts - HTTP/1 parser
packages/nova-http/src/protocol/http1/parser.ts - HTTP messages
packages/nova-http/src/message/index.ts - Response sink
packages/nova-http/src/server/http1-response-sink.ts
HTTP features
- Body parser
packages/nova-http/src/middlewares/body-parser.ts - Static files
packages/nova-http/src/middlewares/static-files.ts - File serving
packages/nova-http/src/static/send-file.ts
Other components
- App developer
- HTTP client
Connections 20
- App developer → Public API: uses
- Public API → App factory: exports
- App factory → Application: creates
- App developer → Project CLI: runs
- Project CLI → App templates: scaffolds from
- HTTP client → TCP server: opens connection
- TCP server → Connection coordinator: creates
- Connection coordinator → HTTP/1 parser: parses bytes
- Connection coordinator → Application: dispatches request
- HTTP/1 parser → HTTP messages: builds messages
- Connection coordinator → Request model: constructs
- Application → Middleware chain: dispatches
- Application → Radix router: matches routes
- Application → Lifecycle hooks: emits events
- Middleware chain → Body parser: runs middleware
- Middleware chain → Static files: runs middleware
- Static files → File serving: sends files
- Application → Response model: produces response
- Response model → Response sink: writes response
- Response sink → Connection coordinator: writes bytes