ergo
Installation
Section titled “Installation”npm install @centralping/ergoMiddleware Overview
Section titled “Middleware Overview”Pipeline Stages
Section titled “Pipeline Stages”| Middleware | Import | Stage | RFC |
|---|---|---|---|
| Logging | @centralping/ergo/http/logger | Negotiation | — |
| Content negotiation | @centralping/ergo/http/accepts | Negotiation | RFC 9110 §12.5 |
| URL parsing | @centralping/ergo/http/url | Negotiation | — |
| Pagination | @centralping/ergo/http/paginate | Negotiation | RFC 8288 |
| CORS | @centralping/ergo/http/cors | Negotiation | Fetch Standard |
| Cookies | @centralping/ergo/http/cookie | Negotiation | RFC 6265 |
| Prefer header | @centralping/ergo/http/prefer | Negotiation | RFC 7240 |
| Conditional requests | @centralping/ergo/http/precondition | Negotiation | RFC 6585 §3 |
| Rate limiting | @centralping/ergo/http/rate-limit | Negotiation | RFC 6585 §4 |
| Authorization | @centralping/ergo/http/authorization | Authorization | RFC 6750, RFC 7617 |
| CSRF protection | @centralping/ergo/http/csrf | Authorization | OWASP |
| Body parsing | @centralping/ergo/http/body | Validation | RFC 7578 |
| JSON Schema validation | @centralping/ergo/http/validate | Validation | — |
| Query validation | @centralping/ergo/http/json-api-query | Validation | JSON:API |
| Idempotency | @centralping/ergo/http/idempotency | Validation | IETF Draft |
| Response sending | @centralping/ergo/http/send | Execution | RFC 9457 |
| Pipeline handler | @centralping/ergo/http/handler | Execution | — |
Cross-Cutting
Section titled “Cross-Cutting”| Middleware | Import | RFC |
|---|---|---|
| Compression | @centralping/ergo/http/compress | RFC 9110 §12.5.3 |
| Cache control | @centralping/ergo/http/cache-control | RFC 9111 |
| Security headers | @centralping/ergo/http/security-headers | RFC 6797 |
| Timeout | @centralping/ergo/http/timeout | — |
| Tracing | @centralping/ergo/http/tracing | W3C Trace Context |
Utilities
Section titled “Utilities”| Module | Import |
|---|---|
| HTTP error creation | @centralping/ergo/utils/http-errors |
| Compose middleware | @centralping/ergo/utils/compose |
| Async iterables | @centralping/ergo/utils/iterables |
| Observable helpers | @centralping/ergo/utils/observables |
| Stream utilities | @centralping/ergo/utils/streams |
| Buffer matching | @centralping/ergo/utils/buffers |