Static Assets
Static asset serving behaves differently in development and release modes.
Development mode
Assets are served from the filesystem at runtime:
/pkg/*— files fromfrontend/pkg/(wasm-pack output)/styles/screen.css— CSS compiled from SCSS, held in memory/favicon.pngand other public files — files fromfrontend/public//*— SPA fallback servesfrontend/index.htmlwith the reload script injected
Release mode (embed-assets feature)
All assets are embedded into the binary at compile time:
frontend/pkg/— embedded viainclude_dir!frontend/index.html— embedded viainclude_bytes!frontend/styles/screen.css— embedded viainclude_bytes!frontend/public/— embedded viainclude_dir!configuration/base.yaml— embedded viainclude_str!
No filesystem access is required at runtime. The binary is fully self-contained.
Path traversal protection
All asset handlers extract only the final path component via Path::file_name() before serving. This prevents path traversal attacks such as /pkg/../../etc/passwd.