18 releases (4 breaking)
| 0.5.3 | Dec 26, 2018 |
|---|---|
| 0.5.2 | Dec 25, 2018 |
| 0.4.3 | Nov 30, 2018 |
| 0.3.2 | Oct 24, 2018 |
| 0.1.4 | Jun 16, 2018 |
#249 in #hyper
Used in 6 crates
235KB
7K
SLoC
Asynchronous Web framework for Rust.
Features
- Type-safe and composable handlers based on
Extractorsystem - Scoped routing and middlewares
- Asynchronous HTTP server based on
tokio,hyperandtower-service- HTTP/1.1 protocol upgrade
- Both of TCP and Unix domain socket support
- TLS support (with
native-tls,rustlsoropenssl)
Usage
use {
std::net::SocketAddr,
tsukuyomi::{
App,
config::prelude::*,
},
tsukuyomi_server::Server,
};
fn main() -> tsukuyomi_server::Result<()> {
let app = App::create(
path!("/")
.to(endpoint::reply("Hello, world.\n"))
)?;
let addr = SocketAddr::from(([127, 0, 0, 1], 4000));
println!("Listening on http://{}", addr);
Server::new(app).bind(addr).run()
}
Resources
Extensions
tsukuyomi-askama- template support usingaskamatsukuyomi-cors- CORS supporttsukuyomi-juniper- GraphQL integration usingjunipertsukuyomi-session- session managementtsukuyomi-tungstenite- WebSocket support usingtungstenite
License
Tsukuyomi is licensed under either of MIT license or Apache License, Version 2.0 at your option.
Dependencies
~10–22MB
~276K SLoC