From cdf50c159c70d79aaef0037d483bf75d1322bfef Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sat, 8 Mar 2025 20:08:45 -0600 Subject: [PATCH] Fix path to static resources In production deployments, the static assets are stored in `/usr/local/share/receipts/static`. The working directory is `/usr/local/share/receipts`, so using a relative path of `static` is sufficient. We can use the same path in development with a symlink pointing to the `esbuild` output directory. --- src/main.rs | 2 +- static | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 120000 static diff --git a/src/main.rs b/src/main.rs index e1408eb..3de0027 100644 --- a/src/main.rs +++ b/src/main.rs @@ -251,6 +251,6 @@ async fn rocket() -> _ { update_transaction ], ) - .mount("/static", FileServer::from("js/dist")) + .mount("/static", FileServer::from("static")) .attach(Template::fairing()) } diff --git a/static b/static new file mode 120000 index 0000000..59cd68f --- /dev/null +++ b/static @@ -0,0 +1 @@ +js/dist \ No newline at end of file