rust-web-server 18.1.0

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::app::controller::index::IndexController;
use crate::application::Application;
use crate::controller::Controller;
use crate::core::New;
use crate::header::Header;

use crate::request::{Request};
use crate::response::{Response, STATUS_CODE_REASON_PHRASE};
use crate::server::ConnectionInfo;

// Kept as documentation of the smallest possible Application impl.
#[allow(dead_code)]
#[derive(Copy, Clone)]
pub struct App {}

impl New for App {
    fn new() -> Self {
        App{}
    }
}

impl Application for App {
    fn execute(&self, request: &Request, connection: &ConnectionInfo) -> Result<Response, String> {
        // predefined set of headers for response, includes client-hints, cors, vary, security and timestamp
        let header_list = Header::get_header_list(request);

        let mut response: Response = Response::get_response(
            STATUS_CODE_REASON_PHRASE.n501_not_implemented,
            Some(header_list),
            None
        );


        if IndexController::is_matching(request, connection) {
            response = IndexController::process(&request, response, connection);
            return Ok(response)
        }


        Ok(response)
    }
}