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().await.unwrap();
http.routes
.get("/", |request| {
println!("Received {} request to {}", request.method, request.path);
Response::text("Hello, World!")
});
http.run().await;
}Structs§
- Request
- An HTTP 1.1 request.
- Response
- An HTTP 1.1 response.
- Server
- The server is responsible for accepting connections and routing requests.
Enums§
- Body
- The HTTP Body of a request.
- Method
- The HTTP Method of a request.
- Status
Code - The HTTP status code of a response.