Expand description
The Nitr HTTP server layer: hyper server and builder, configuration, and the request/response bridge between HTTP and the Lua runtime.
Modules§
- service
- The hyper
Servicedispatching requests to the Lua pool. - testing
- In-process testing: dispatch requests through the full protection /
router / middleware / handler path without binding a socket. This is
the foundation of
nitr testand of Rust-level integration tests.
Structs§
- Cache
Config - The shared
nitr.cache([cache]section). - Compression
Config - Response compression (
[compression]section). - Config
- Server configuration, typically loaded from a
nitr.tomlfile. - Cookies
Config - Cookie defaults (
[cookies]section). - Cors
Config - Cross-origin resource sharing (
[cors]section). - Database
Config - SQLite settings (
[database]section). - Fetch
Config - Outbound-request policy for the
fetchbuiltin ([fetch]section). By default, requests to loopback/private/link-local addresses are refused (SSRF protection) and every redirect hop is re-checked. - Health
Config - Health and readiness endpoints (
[health]section), answered entirely in Rust. - Limits
Config - Request-size and connection limits (
[limits]section), enforced in Rust before a request reaches Lua. - LogConfig
- Log output (
[log]section). - LuaConfig
- Lua runtime settings (
[lua]section). - Multipart
Config - Filesystem policy for multipart uploads (
[multipart]section). - Open
ApiConfig - The generated OpenAPI document (
[openapi]section). - Rate
Limit Config - Per-client-IP fixed-window rate limiting (
[rate_limit]section). Disabled by default; rejections answer 429 with aRetry-Afterheader. - Server
- The Nitr HTTP server: a pool of Lua runtimes behind a shared listener.
- Server
Builder - Builder for
Server. - Shutdown
Config - Graceful-shutdown timing (
[shutdown]section). - Static
Config - Static file serving (
[static]section): aGETorHEADundermountthat no route serves with that method is answered fromdirentirely in Rust, without a Lua state. Scripts can add further mounts withapp:static(mount, dir, opts?). - StdConfig
- Standard library selection (
[std]section): which built-innitr.*modules are exposed to scripts. - Swagger
Config - The Swagger UI page (
[swagger]section). - TlsConfig
- Inbound TLS termination (
[tls]section), served by rustls over theringcrypto provider.
Enums§
- Cookie
Secure - When cookies Nitr builds carry the
Secureattribute ([cookies] secure). - LogFormat
- How log lines are rendered.