Compare commits
2 commits
b6a17184eb
...
0097a0533a
Author | SHA1 | Date | |
---|---|---|---|
0097a0533a | |||
6ea6d1742e |
1 changed files with 14 additions and 4 deletions
|
@ -1,11 +1,11 @@
|
|||
pub mod activitypub;
|
||||
|
||||
#[cfg(feature = "web")]
|
||||
pub mod web;
|
||||
|
||||
#[cfg(feature = "mastodon")]
|
||||
pub mod mastodon;
|
||||
|
||||
#[cfg(feature = "web")]
|
||||
pub mod web;
|
||||
|
||||
pub mod builders;
|
||||
|
||||
#[cfg(not(feature = "mastodon"))]
|
||||
|
@ -26,7 +26,17 @@ pub async fn serve(ctx: upub::Context, bind: String) -> upub::Result<()> {
|
|||
.ap_routes()
|
||||
.mastodon_routes() // no-op if mastodon feature is disabled
|
||||
.layer(CorsLayer::permissive())
|
||||
.layer(TraceLayer::new_for_http())
|
||||
.layer(
|
||||
TraceLayer::new_for_http()
|
||||
.make_span_with(|req: &axum::http::Request<_>| {
|
||||
tracing::span!(
|
||||
tracing::Level::INFO,
|
||||
"request",
|
||||
uri = %req.uri(),
|
||||
status_code = tracing::field::Empty,
|
||||
)
|
||||
})
|
||||
)
|
||||
.with_state(ctx);
|
||||
|
||||
// run our app with hyper, listening locally on port 3000
|
||||
|
|
Loading…
Reference in a new issue