Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1diff --git a/server/src/infra/tcp_server.rs b/server/src/infra/tcp_server.rs 2index 43f65ea..e289f2a 100644 3--- a/server/src/infra/tcp_server.rs 4+++ b/server/src/infra/tcp_server.rs 5@@ -26,7 +26,7 @@ use std::sync::RwLock; 6 use tracing::info; 7 8 async fn index() -> actix_web::Result<NamedFile> { 9- let path = PathBuf::from(r"app/index.html"); 10+ let path = PathBuf::from(r"@frontend@/index.html"); 11 Ok(NamedFile::open(path)?) 12 } 13 14@@ -68,12 +68,12 @@ pub(crate) fn error_to_http_response(error: TcpError) -> HttpResponse { 15 } 16 17 async fn wasm_handler() -> actix_web::Result<impl Responder> { 18- Ok(actix_files::NamedFile::open_async("./app/pkg/lldap_app_bg.wasm").await?) 19+ Ok(actix_files::NamedFile::open_async("@frontend@/pkg/lldap_app_bg.wasm").await?) 20 } 21 22 async fn wasm_handler_compressed() -> actix_web::Result<impl Responder> { 23 Ok( 24- actix_files::NamedFile::open_async("./app/pkg/lldap_app_bg.wasm.gz") 25+ actix_files::NamedFile::open_async("@frontend@/pkg/lldap_app_bg.wasm.gz") 26 .await? 27 .customize() 28 .insert_header(header::ContentEncoding::Gzip) 29@@ -118,11 +118,11 @@ fn http_config<Backend>( 30 ) 31 .service(web::resource("/pkg/lldap_app_bg.wasm").route(web::route().to(wasm_handler))) 32 // Serve the /pkg path with the compiled WASM app. 33- .service(Files::new("/pkg", "./app/pkg")) 34+ .service(Files::new("/pkg", "@frontend@/pkg")) 35 // Serve static files 36- .service(Files::new("/static", "./app/static")) 37+ .service(Files::new("/static", "@frontend@/static")) 38 // Serve static fonts 39- .service(Files::new("/static/fonts", "./app/static/fonts")) 40+ .service(Files::new("/static/fonts", "@frontend@/static/fonts")) 41 // Default to serve index.html for unknown routes, to support routing. 42 .default_service(web::route().guard(guard::Get()).to(index)); 43 }