~garritfra/express-rs

A simple express-inspired web framework written in your favorite programming language🦀
cb812e99 — Garrit Franke 4 years ago
chore: http: refactor Mount "matches" functions
c6b385cf — Garrit Franke 4 years ago
WIP: http: implement dynamic routes
2cbaed96 — Garrit Franke 4 years ago
chore: rename test_lib -> lib

clone

read-only
https://git.sr.ht/~garritfra/express-rs
read/write
git@git.sr.ht:~garritfra/express-rs

You can also use your local clone with git send-email.

#express-rs

This crate emulates the behavior of the Express.js framework for Rust.

https://crates.io/crates/express-rs

#State of the Project

  • [x] Simple GET/POST/PUT/DELETE requests
  • [x] Body parsing
  • [x] Status codes
  • [x] Header parsing
  • [ ] proper HTML rendering
  • [ ] Dynamic query and route params
  • [ ] Multithreading

#Example

See examples directory for more examples

use express_rs::Express;

fn main() {
    let mut app = Express::new();

    app.get("/", |_, res| res.send("Hello World!".to_string()));

    app.listen(8080);
}

#License

This project is licensed under either of

at your option.