Compare commits

...

3 commits

2 changed files with 5 additions and 5 deletions

View file

@ -25,11 +25,10 @@ pub async fn serve(ctx: upub::Context, bind: String) -> upub::Result<()> {
use tower_http::{cors::CorsLayer, trace::TraceLayer};
let router = axum::Router::new()
.layer(CorsLayer::permissive())
.layer(
// TODO 4xx errors aren't really failures but since upub is in development it's useful to log
// these too, in case something's broken
TraceLayer::new(SharedClassifier::new(StatusInRangeAsFailures::new(300..=u16::MAX)))
TraceLayer::new(SharedClassifier::new(StatusInRangeAsFailures::new(300..=999)))
.make_span_with(|req: &axum::http::Request<_>| {
tracing::span!(
tracing::Level::INFO,
@ -39,6 +38,7 @@ pub async fn serve(ctx: upub::Context, bind: String) -> upub::Result<()> {
)
})
)
.layer(CorsLayer::permissive())
.ap_routes()
.mastodon_routes() // no-op if mastodon feature is disabled
.with_state(ctx);

View file

@ -76,10 +76,10 @@ pub fn ConfigPage(setter: WriteSignal<crate::Config>) -> impl IntoView {
let mut val = event_target_value(&ev);
if val.is_empty() { val = DEFAULT_COLOR.to_string() };
let mut mock = config.get();
mock.accent_color = val.clone();
setter.set(mock);
set_color_rgb.set(parse_hex(&val));
set_color.set(val);
set_color.set(val.clone());
mock.accent_color = val;
setter.set(mock);
} />
</p>
<hr />