simple-web-app

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 866227f55e4edfc11bea767e83ef15c37d3df14e
parent 0efc4bd8868ec768d981da5c9773503cb2372ce6
Author: Silas Brack <silasbrack@gmail.com>
Date:   Tue, 21 Apr 2026 21:55:47 +0200

fix: serve pre-compressed static files

Use ServeDir::precompressed_gzip() to serve .gz files when client accepts gzip.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Diffstat:
Msrc/routes.rs | 2+-
Astatic/style.css.gz | 0
2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/routes.rs b/src/routes.rs @@ -14,6 +14,6 @@ pub fn create_router(state: AppState) -> Router { .route("/search", post(handlers::search)) .route("/settings", get(handlers::open_settings)) .route("/settings/tab", get(handlers::open_settings_tab)) - .nest_service("/static", ServeDir::new("static")) + .nest_service("/static", ServeDir::new("static").precompressed_gzip()) .with_state(state) } diff --git a/static/style.css.gz b/static/style.css.gz Binary files differ.