Crates.io | webforge |
lib.rs | webforge |
version | 0.1.1 |
source | src |
created_at | 2023-09-12 08:01:42.93697 |
updated_at | 2023-09-12 08:19:39.461472 |
description | A simple http server API for rust. |
homepage | |
repository | |
max_upload_size | |
id | 970496 |
size | 4,345 |
a simple http server written in rust
#[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.