fix: docs test
This commit is contained in:
parent
61d95ec3e9
commit
b59c9c45fa
2 changed files with 8 additions and 8 deletions
|
|
@ -91,7 +91,7 @@ moka = { version = "0.12.8", features = ["future"] }
|
||||||
axum = { version = "0.7.5", features = [
|
axum = { version = "0.7.5", features = [
|
||||||
"json",
|
"json",
|
||||||
], default-features = false, optional = true }
|
], default-features = false, optional = true }
|
||||||
axum-extra = { version = "0.9.3", optional = true }
|
axum-extra = { version = "0.9.3", features = ["typed-header"], optional = true }
|
||||||
tower = { version = "0.4.13", optional = true }
|
tower = { version = "0.4.13", optional = true }
|
||||||
hyper = { version = "1.4.1", optional = true }
|
hyper = { version = "1.4.1", optional = true }
|
||||||
http-body-util = { version = "0.1.2", optional = true }
|
http-body-util = { version = "0.1.2", optional = true }
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,9 @@ The next step is to allow other servers to fetch our actors and objects. For thi
|
||||||
# use activitypub_federation::config::FederationMiddleware;
|
# use activitypub_federation::config::FederationMiddleware;
|
||||||
# use axum::routing::get;
|
# use axum::routing::get;
|
||||||
# use crate::activitypub_federation::traits::Object;
|
# use crate::activitypub_federation::traits::Object;
|
||||||
# use axum::headers::ContentType;
|
# use axum_extra::headers::ContentType;
|
||||||
# use activitypub_federation::FEDERATION_CONTENT_TYPE;
|
# use activitypub_federation::FEDERATION_CONTENT_TYPE;
|
||||||
# use axum::TypedHeader;
|
# use axum_extra::TypedHeader;
|
||||||
# use axum::response::IntoResponse;
|
# use axum::response::IntoResponse;
|
||||||
# use http::HeaderMap;
|
# use http::HeaderMap;
|
||||||
# async fn generate_user_html(_: String, _: Data<DbConnection>) -> axum::response::Response { todo!() }
|
# async fn generate_user_html(_: String, _: Data<DbConnection>) -> axum::response::Response { todo!() }
|
||||||
|
|
@ -33,11 +33,11 @@ async fn main() -> Result<(), Error> {
|
||||||
.route("/user/:name", get(http_get_user))
|
.route("/user/:name", get(http_get_user))
|
||||||
.layer(FederationMiddleware::new(data));
|
.layer(FederationMiddleware::new(data));
|
||||||
|
|
||||||
let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
|
let listener = tokio::net::TcpListener::bind("127.0.0.1:3000")
|
||||||
tracing::debug!("listening on {}", addr);
|
.await
|
||||||
axum::Server::bind(&addr)
|
.unwrap();
|
||||||
.serve(app.into_make_service())
|
tracing::debug!("listening on {}", listener.local_addr().unwrap());
|
||||||
.await?;
|
axum::serve(listener, app).await.unwrap();
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue