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