Skip to content

v2.0.0

Choose a tag to compare

@github-actions github-actions released this 10 Jul 20:32
· 9 commits to main since this release
868f50e

2.0.0 (2025-07-10)

Breaking Changes

  • server: extend middleware registration, config options, and test coverage (868f50e)

- Middleware:
  • Add togglable middleware support at global, router, and route level
  • Register CORS and Logging middleware based on config flags
  • Inject structured logger into request context via LoggingMiddleware

- Configuration:
  • Expand `ramchi.config.json` with:
    ◦ enableCORS, allowedOrigins
    ◦ enableRequestLogging
    ◦ enableTLS, tlsCertFile, tlsKeyFile
    ◦ read/write/idle timeouts and maxHeaderBytes
  • Middleware toggling tied directly to these fields

- Tests:
  • Added validation for CORS headers
  • Added logger context assertion
  • Error routes now return JSON-formatted error messages
  • Assert proper registration paths and method handling

- Docs:
  • README now documents all configuration fields
  • Added togglable middleware section

BREAKING CHANGE:
- Middleware registration is now config-driven. Any middleware not explicitly enabled via config will not be applied.
- LoggingMiddleware depends on `enableRequestLogging` in config.
- CORSMiddleware requires both `enableCORS=true` and non-empty `allowedOrigins`.
- `ramchi/config.New()` must be called before any server instantiation.
- Routes and middleware marked as `Experimental=true` require `"experimental": true` in config.
- Errors are no longer returned using `Handle()` (removed); replace with explicit JSON writing (e.g., `json.NewEncoder(w).Encode(...)`).

Feature

Bug Fixes

  • add proper error handling (3f5a946)
  • add default config option (d652359)

Chores