meiseayoung
|
4e2c6a90c3
|
feat: add 7 built-in middleware components inspired by Hono.js
New Middleware:
- CORS: Cross-Origin Resource Sharing with full configuration support
- Cookie Helper: Cookie management with signed cookie support (HMAC-SHA256)
- JWT: JSON Web Token authentication (HS256/384/512)
- Bearer Auth: Simple Bearer token authentication
- Compression: Gzip and deflate response compression
- Rate Limiting: Request rate limiting with customizable stores
- Validator: Schema-based request validation
Features:
- Context store for middleware data sharing (get/set/get_client_ip)
- Middleware export module with utility functions
- Comprehensive property-based tests for all middleware
- Example file demonstrating all middleware usage
Files Added:
- cors.v, cookie.v, jwt.v, bearer_auth.v, compress.v, rate_limit.v, validator.v
- middleware.v (unified exports)
- examples/middleware_demo.v
- tests/test_*.v (9 new test files)
Documentation:
- Updated README.md with detailed middleware usage guide
- Added Schema Builder API documentation
|
2026-01-04 11:11:15 +08:00 |
|
meiseayoung
|
05bb2d6c95
|
feat: cross-platform uSockets support and route cache optimization
1. Cross-platform uSockets configuration
- Use @VMODROOT for portable library paths
- Support macOS (arm64/x86_64), Windows, and Linux
- Auto-detect Homebrew paths for libuv on macOS
2. Route cache optimization (3x performance boost)
- Replace LRU cache with FastRouteCache for dynamic routes
- Zero-overhead cache lookup (no TTL check, no LRU reordering)
- Dynamic route performance: 30k -> 97k RPS
3. New test files
- Go-based integration tests for picoev and uSockets
- FastCache optimization validation tests
- Benchmark comparison tools
|
2026-01-02 21:44:07 +08:00 |
|