BenMcAvoy / Rustigo

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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();
}

About

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

License:MIT License


Languages

Language:Rust 100.0%