#home #listener #http-response #80

guest-server

A simple HTTP server implementation

8 releases

0.1.7 Jan 26, 2025
0.1.6 Dec 31, 2024
0.1.3 Nov 28, 2024

#493 in HTTP server

Download history 22/week @ 2024-12-05 124/week @ 2024-12-12 15/week @ 2024-12-19 90/week @ 2024-12-26 28/week @ 2025-01-02 3/week @ 2025-01-09 104/week @ 2025-01-23 13/week @ 2025-01-30 6/week @ 2025-02-06 16/week @ 2025-02-13

655 downloads per month

MIT license

15KB
209 lines

A Simple HTTP Server Implementation

Example

Create a server instance and register a GET route:

use guest_server::{Server, HttpResponse};

let mut server = Server::new();

server.get("/", home);

fn home(query_params: Option<Vec<u8>>) -> HttpResponse {
        HttpResponse::new(200, Some("Hello, World!".to_string()))
}

server.listener(80);

No runtime deps