Skip to content

Commit

Permalink
Fix #578 file handling
Browse files Browse the repository at this point in the history
  • Loading branch information
joepio committed Feb 8, 2023
1 parent 320ffe7 commit c0db207
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ features = ["rustls"]
version = "4"

[dependencies.actix-web-static-files]
# https://github.com/kilork/actix-web-static-files/pull/55#pullrequestreview-1286027898
git = "https://github.com/joepio/actix-web-static-files/"
rev = "3b4b2e3b204ba5f628bb240ecc490edd9cd7f88d"
version = "4"

[dependencies.atomic_lib]
Expand Down
2 changes: 1 addition & 1 deletion server/src/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub fn config_routes(app: &mut actix_web::web::ServiceConfig) {
app.service(web::resource("/ws").to(handlers::web_sockets::web_socket_handler))
.service(web::resource("/download/{path:[^{}]+}").to(handlers::download::handle_download))
// This `generate` imports the static files from the `app_assets` folder
.service(ResourceFiles::new("/", generate()).do_use_guard())
.service(ResourceFiles::new("/", generate()).skip_handler_when_not_found())
// Catch all (non-download) HTML requests and send them to the single page app
.service(
web::resource(ANY)
Expand Down

0 comments on commit c0db207

Please sign in to comment.