Skip to main content

Crate nitr_http

Crate nitr_http 

Source
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 Service dispatching 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 test and of Rust-level integration tests.

Structs§

CacheConfig
The shared nitr.cache ([cache] section).
CompressionConfig
Response compression ([compression] section).
Config
Server configuration, typically loaded from a nitr.toml file.
CookiesConfig
Cookie defaults ([cookies] section).
CorsConfig
Cross-origin resource sharing ([cors] section).
DatabaseConfig
SQLite settings ([database] section).
FetchConfig
Outbound-request policy for the fetch builtin ([fetch] section). By default, requests to loopback/private/link-local addresses are refused (SSRF protection) and every redirect hop is re-checked.
HealthConfig
Health and readiness endpoints ([health] section), answered entirely in Rust.
LimitsConfig
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).
MultipartConfig
Filesystem policy for multipart uploads ([multipart] section).
OpenApiConfig
The generated OpenAPI document ([openapi] section).
RateLimitConfig
Per-client-IP fixed-window rate limiting ([rate_limit] section). Disabled by default; rejections answer 429 with a Retry-After header.
Server
The Nitr HTTP server: a pool of Lua runtimes behind a shared listener.
ServerBuilder
Builder for Server.
ShutdownConfig
Graceful-shutdown timing ([shutdown] section).
StaticConfig
Static file serving ([static] section): a GET or HEAD under mount that no route serves with that method is answered from dir entirely in Rust, without a Lua state. Scripts can add further mounts with app:static(mount, dir, opts?).
StdConfig
Standard library selection ([std] section): which built-in nitr.* modules are exposed to scripts.
SwaggerConfig
The Swagger UI page ([swagger] section).
TlsConfig
Inbound TLS termination ([tls] section), served by rustls over the ring crypto provider.

Enums§

CookieSecure
When cookies Nitr builds carry the Secure attribute ([cookies] secure).
LogFormat
How log lines are rendered.