0.5.0
This release introduces the ability to nest applications, add logging
middleware, and improves our documentation.
Nesting applications is a useful technique that can be used to create several
sub-applications. This allows creating clear points of isolation in applications
that can be used completely independently of the main application. But can be
recombined into a single binary if required.
Being able to nest applications is also a necessary first step to re-introduce
per-route middleware, which we'll do in subsequent patches.
Examples
let mut inner = tide::new();
inner.at("/").get(|_| async { "root" });
inner.at("/foo").get(|_| async { "foo" });
inner.at("/bar").get(|_| async { "bar" });
let mut outer = tide::new();
outer
.at("/nested")
.strip_prefix() // catch /nested and /nested/*
.get(inner.into_http_service()); // the prefix /nested will be stripped here
Added
- Added
Route::strip_prefix
(#364) - Added the ability
Service
s to be nested (#364) - Added
middleware::RequestLogger
(#367)
Changed
- Updated and improved the documentation (#363)