#web #back-end

pillow-config

Load configuration from pillow.toml to pillow framework

1 unstable release

0.1.0 Aug 19, 2023

#1072 in HTTP server

29 downloads per month

Custom license

4KB
90 lines

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

Dependencies

~0.6–1.2MB
~27K SLoC