44 breaking releases
| 0.56.0 | Jul 2, 2025 |
|---|---|
| 0.54.0 | May 7, 2025 |
| 0.53.0 | Mar 12, 2025 |
| 0.49.0 | Nov 12, 2024 |
| 0.13.0 | Mar 27, 2023 |
#2811 in HTTP server
2,576 downloads per month
64KB
878 lines
Shuttle service integration for the Thruster web framework
Example
use thruster::{
context::basic_hyper_context::{generate_context, BasicHyperContext as Ctx, HyperRequest},
m, middleware_fn, App, HyperServer, MiddlewareNext, MiddlewareResult, ThrusterServer,
};
#[middleware_fn]
async fn hello(mut context: Ctx, _next: MiddlewareNext<Ctx>) -> MiddlewareResult<Ctx> {
context.body("Hello, World!");
Ok(context)
}
#[shuttle_runtime::main]
async fn thruster() -> shuttle_thruster::ShuttleThruster<HyperServer<Ctx, ()>> {
let server = HyperServer::new(
App::<HyperRequest, Ctx, ()>::create(generate_context, ()).get("/", m![hello]),
);
Ok(server.into())
}
Dependencies
~19–29MB
~427K SLoC