| Crates.io | light_pencil |
| lib.rs | light_pencil |
| version | 0.4.4 |
| created_at | 2017-10-20 21:51:32.651079+00 |
| updated_at | 2017-11-08 11:21:45.537366+00 |
| description | A micro web framework for Rust. (A very light fork of a Pencil fork) |
| homepage | https://github.com/luciusmagnn/light_pencil |
| repository | https://github.com/luciusmagn/light_pencil |
| max_upload_size | |
| id | 36409 |
| size | 67,844 |
A microframework for Rust inspired by Flask.
extern crate light_pencil;
use light_pencil::{Pencil, Request, Response, PencilResult};
fn hello(_: &mut Request) -> PencilResult {
Ok(Response::from("Hello World!"))
}
fn main() {
let mut app = Pencil::new("/web/hello");
app.get("/", "hello", hello);
app.run("127.0.0.1:5000");
}
One simple guide: https://fengsp.github.io/blog/2016/3/introducing-pencil/ Documentation: https://fengsp.github.io/pencil/pencil/