Crates.io | rustigo |
lib.rs | rustigo |
version | 1.1.3 |
source | src |
created_at | 2023-12-10 23:08:13.384006 |
updated_at | 2024-03-28 20:08:54.162148 |
description | A Rust webserver inspired by the Go standard library's HTTPServer |
homepage | https://github.com/BenMcAvoy/Rustigo |
repository | https://github.com/BenMcAvoy/Rustigo |
max_upload_size | |
id | 1064585 |
size | 16,796 |
A Rust webserver inspired by the Go standard library's HTTPServer
use rustigo::prelude::*;
fn index(stream: TcpStream, _: Request) {
html!(stream; "<h1>Hello, world!</h1>");
}
fn main() {
let mut rustigo = Rustigo::default();
rustigo.handle("/", Arc::new(index));
rustigo.listen("localhost:7878", 4).unwrap();
}