blacktea

Crates.ioblacktea
lib.rsblacktea
version0.1.1
sourcesrc
created_at2021-06-18 04:56:46.629263
updated_at2021-06-18 11:22:42.348246
descriptionA new comfortable back end framework for rustaceans
homepagehttps://blacktea.lirui.tech
repositoryhttps://github.com/KernelErr/blacktea
max_upload_size
id411643
size34,402
Rui Li (KernelErr)

documentation

README

Black Tea

Under heavy development, can not use in production environment.

Language: English | 简体中文

Would you like to have one cup of warm black tea?

Homepage & Document: Black Tea(Under Construction) Discord: Black Tea

Black Tea is a new Rust back end framework based on hyper. We are enthusiastic to provide developers some enhanced features and comfortable coding experience.

Quick Start

Add dependencies in Cargo.toml:

[dependencies]
blacktea = "0.1.1"
tokio = { version = "1", features = ["full"] }
# Enable logging
# log = "0.4"
# pretty_env_logger = "0.4"

Minimal Example Code

use blacktea::{Server, HttpResponse, Method, App};

async fn hello() -> HttpResponse {
    HttpResponse::Ok().text("Hello, world!".into())
}

#[tokio::main]
async fn main() {
    // Enable logging, set RUST_LOG=info
    // pretty_env_logger::init();
    let mut server = Server::new("127.0.0.1:8080".into());
	let mut app = App::new();
	app.add("/hello", Method::GET, Box::new(hello));
    server.mount("/v1", app);
    server.run().await
}

Contribution

Currently Black Tea needs your contribution! To be one of us quickly, you can contact with KernelErr directly to get a brief view of this project.

License

Black Tea is available under Apache License 2.0, you are also subjected to all dependencies' licenses.

Commit count: 11

cargo fmt