Crates.io | guest-server |
lib.rs | guest-server |
version | 0.1.4 |
source | src |
created_at | 2024-11-28 09:29:17.045918 |
updated_at | 2024-12-02 06:26:06.158636 |
description | A simple HTTP server implementation |
homepage | https://github.com/guestOfficer/guest |
repository | https://github.com/guestOfficer/guest |
max_upload_size | |
id | 1464074 |
size | 10,147 |
A simple HTTP server implementation in Rust, designed for educational purposes or lightweight projects. This library provides a basic mechanism for handling HTTP GET requests and simulating a server response.
Create a Server
instance, register a GET route, and start the server:
use guest_server::Server;
let mut server = Server::new();
server.get("/", || "HTTP/1.1 200 OK\r\n\r\nHello, World!".to_string());
server.listener("127.0.0.1:8080");