soulstompp / pencil

A web application microframework for Rust

Home Page:https://fengsp.github.io/pencil/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#Pencil

Build Status Crates.io Version Crates.io LICENSE

A microframework for Rust inspired by Flask.

extern crate pencil;

use 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.

About

A web application microframework for Rust

https://fengsp.github.io/pencil/

License:Other


Languages

Language:Rust 99.4%Language:Shell 0.4%Language:Makefile 0.2%