Skip to content

SummaryPuppet/pillow_framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pillow Framework

Is a web framework for rust

Getting started

With pillow-cli

Need cargo, cargo-watch and cargo-generate

cargo install pillow-cli

pillow-cli init <example_project>

Manual

Add dependency

[dependencies]
pillow = "0.3.0"
tokio = {version = "1.23.0", features = ["macros"]}

Simple Server

use pillow::http::*;

#[controller(method = "GET", path = "/")]
fn index(){
  Response::text("hello")
}

#[tokio::main]
async fn main() {
  let mut router = MainRouter::new();

  router.add_route(route!(index {}));
  router.get("/users", |_request| Response::text("users"));

  let server = Server::default();

  server.run(&router).await:
}

Documentation

Lincese

MIT Lincese

Contribution