WebForge
a simple http server written in rust
Example
async
Also make sure put the .html files in the src/res directory.
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.