rust-web-server 18.8.1

Single-binary web server and reverse proxy: automatic HTTPS (Let's Encrypt), HTTP/1.1, HTTP/2 and HTTP/3, load balancing, auth and rate limiting, configured in one TOML file. Also a Rust library: routing, middleware, MCP server, ORM, background jobs. No hyper, no Tower; HTTP/2 and HTTP/3 framing via h2 and quinn.
Documentation
use crate::entry_point::{bootstrap, get_ip_port_thread_count, get_max_body_size, Config};

#[test]
fn base(){
    let _g = crate::test_env::lock();
    bootstrap();
    get_ip_port_thread_count();
}

#[test]
fn get_max_body_size_defaults_to_unlimited() {
    let _g = crate::test_env::lock();
    std::env::remove_var(Config::RWS_CONFIG_MAX_BODY_SIZE_IN_BYTES);
    assert_eq!(0, get_max_body_size());
}

#[test]
fn get_max_body_size_reads_env_var() {
    let _g = crate::test_env::lock();
    std::env::set_var(Config::RWS_CONFIG_MAX_BODY_SIZE_IN_BYTES, "1048576");
    assert_eq!(1048576, get_max_body_size());
    std::env::remove_var(Config::RWS_CONFIG_MAX_BODY_SIZE_IN_BYTES);
}

#[test]
fn get_max_body_size_falls_back_to_unlimited_on_unparseable_value() {
    let _g = crate::test_env::lock();
    std::env::set_var(Config::RWS_CONFIG_MAX_BODY_SIZE_IN_BYTES, "not-a-number");
    assert_eq!(0, get_max_body_size());
    std::env::remove_var(Config::RWS_CONFIG_MAX_BODY_SIZE_IN_BYTES);
}