#server-api #tokio

webforge

A simple http server API for rust

1 unstable release

0.1.1 Sep 12, 2023
0.1.0 Sep 12, 2023

#917 in HTTP server

Download history 5/week @ 2024-02-17 28/week @ 2024-02-24 1/week @ 2024-03-02 9/week @ 2024-03-09 1/week @ 2024-03-16 30/week @ 2024-03-30 3/week @ 2024-04-06 39/week @ 2024-04-20

72 downloads per month

MIT license

5KB
58 lines

WebForge

a simple http server written in rust

Example

#[tokio::main]
async fn main() {
    println!("Starting HTTP server...");
    let mut server: HTTPServer = HTTPServer::new(([127, 0, 0, 1], 8080).into());
    server.insert("/".to_string(), || {
        return (200, "index.html".to_string());
    });
    server.start().await;
}

Also make sure put the .html files in the src/res directory.

Other

quick note: for now this project is WIP.

Dependencies

~4–12MB
~101K SLoC