fetchlet-http 0.1.1

Serve fetchlet applications through Tower, hyper, axum and actix-web
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use axum::Router;

use fetchlet::FetchTransport;

use crate::service_transport;

/// Serve host fetches with an axum `Router`.
///
/// This is [`service_transport`] for a router: register it
/// with [`fetchlet::OriginRouter::internal`] to share one router between
/// public HTTP and in-process fetches. Handlers read the trusted Context with
/// `Option<Extension<fetchlet::Context>>`.
pub fn router_transport(router: Router) -> impl FetchTransport {
    service_transport(router)
}