3 个版本
使用旧的 Rust 2015
| 0.1.2 | 2016年9月6日 | 
|---|---|
| 0.1.1 | 2016年9月5日 | 
| 0.1.0 | 2016年9月5日 | 
#5 in #undocumented
5KB
104 行
Corruption
使用 👣 制作的未记录 Rust 网页框架
用法
不要使用。开发中。
extern crate corruption;
use corruption::Corruption;
use corruption::response::Response;
fn main() {
    // Start Corruption
    let mut corruption = Corruption::new();
    // Declare routes
    corruption
        .get("/test", |_| Response::html_str("<p>test ok</p>") )
        .get("/test2", |_| Response::html_str("<p>test 2 ok</p>") );
    // Serve it to the world on 127.0.0.1:8080
    corruption.serve();
}
待办事项
- 请求
- 中间件
- 使用 handlebars
- 路由参数
依赖关系
~10MB
~223K SLoC