9 releases

Uses old Rust 2015

0.6.1 Jul 24, 2022
0.6.0 Oct 7, 2020
0.5.0 Oct 1, 2020
0.4.5 Sep 30, 2020
0.3.2 Mar 2, 2017

#682 in HTTP server

BSD-3-Clause

225KB
2.5K SLoC

Sharp Pencil

This is a web framework in syncronous Rust, based on Hyper 0.10 and originally developed circa 2016. It's a fork of unmaintained framework Pencil. The origin of this fork can be traced to this message: https://github.com/fengsp/pencil/issues/49

Build Status Crates.io Version Crates.io LICENSE

A microframework for Rust inspired by Flask.

extern crate pencil;

use sharp_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/

If you feel anything wrong, feedbacks or pull requests are welcome.

Dependencies

~14–28MB
~434K SLoC