- Add stdlib/http.lux with:
- Response builders (httpOk, httpNotFound, etc.)
- Path pattern matching with parameter extraction
- JSON construction helpers (jsonStr, jsonNum, jsonObj, etc.)
- Add examples/http_api.lux demonstrating a complete REST API
- Add examples/http_router.lux showing the routing pattern
- Update stdlib/lib.lux to include http module
The framework provides functional building blocks for web apps:
- Route matching: pathMatches("/users/:id", path)
- Path params: getPathSegment(path, 1)
- Response building: httpOk(jsonObj(...))
Note: Due to current type system limitations with type aliases
and function types, the framework uses inline types rather
than abstract Request/Response types.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
6.2 KiB
6.2 KiB