rustigo

Crates.iorustigo
lib.rsrustigo
version1.1.3
sourcesrc
created_at2023-12-10 23:08:13.384006
updated_at2024-03-28 20:08:54.162148
descriptionA Rust webserver inspired by the Go standard library's HTTPServer
homepagehttps://github.com/BenMcAvoy/Rustigo
repositoryhttps://github.com/BenMcAvoy/Rustigo
max_upload_size
id1064585
size16,796
Ben McAvoy (BenMcAvoy)

documentation

README

Rustigo

A Rust webserver inspired by the Go standard library's HTTPServer

Features:

  • Lightweight
  • Pattern matched routes
  • No dependencies

Example

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();
}
Commit count: 46

cargo fmt