tangled
alpha
login
or
join now
aleeve.dev
/
ott
2
fork
atom
Scalable and distributed custom feed generator, ott - on that topic
2
fork
atom
overview
issues
pulls
pipelines
Perhaps fix error with forced doubling slashes
aleeve.dev
4 months ago
d463fe14
988956a7
+7
-2
3 changed files
expand all
collapse all
unified
split
crates
Cargo.lock
ott-xrpc
Cargo.toml
src
main.rs
+1
crates/Cargo.lock
···
3432
3432
"serde",
3433
3433
"serde_json",
3434
3434
"tokio",
3435
3435
+
"tower-http",
3435
3436
"tracing",
3436
3437
"tracing-subscriber",
3437
3438
"url",
+1
crates/ott-xrpc/Cargo.toml
···
24
24
serde = { version = "1.0.228", features = ["derive"] }
25
25
serde_json = "1.0.145"
26
26
tokio = { version = "1.47.1", features = ["full"] }
27
27
+
tower-http = { version = "0.6.6", features = ["normalize-path"] }
27
28
tracing = "0.1.41"
28
29
tracing-subscriber = { version = "0.3.20", features = ["env-filter"] }
29
30
url = "2.5.7"
+5
-2
crates/ott-xrpc/src/main.rs
···
21
21
use tracing::info;
22
22
use tracing_subscriber::EnvFilter;
23
23
24
24
+
use tower_http::normalize_path::NormalizePathLayer;
25
25
+
24
26
async fn handle_wellknown_atproto_did() -> Json<serde_json::Value> {
25
27
Json::from(Value::from("did:web:ott.aleeve.dev"))
26
28
}
···
68
70
69
71
let service = Service {
70
72
id: "#bsky_fg".into(),
71
71
-
service_endpoint: Some("https://ott.aleeve.dev/".into()),
73
73
+
service_endpoint: Some("https://ott.aleeve.dev".into()),
72
74
r#type: "BskyFeedGenerator".into(),
73
75
extra_data: BTreeMap::default(),
74
76
};
···
92
94
.route(
93
95
"/.well-known/atproto-did",
94
96
get(handle_wellknown_atproto_did),
95
95
-
);
97
97
+
)
98
98
+
.layer(NormalizePathLayer::trim_trailing_slash());
96
99
97
100
let listener = tokio::net::TcpListener::bind("0.0.0.0:8080").await.unwrap();
98
101
info!("Starting service");