Crate lil_http

source ·
Expand description

lil_http is a simple HTTP server library for Rust.

Example

use lil_http::{Server, Response};

#[tokio::main]
async fn main() {
   let mut http = Server::new().unwrap();

  http.routes
      .get("/", |request| {
        println!("Received {} request to {}", request.method, request.path);

       Response::text("Hello, World!")
   });

  http.run().await;
}

Structs

An HTTP 1.1 request.
An HTTP 1.1 response.
The server is responsible for accepting connections and routing requests.

Enums

The HTTP Body of a request.
The HTTP Method of a request.
The HTTP status code of a response.