fix(fullstack): Allow configuration of the public_path (#3419)
This commit is contained in:
1 parent
e96550c48c
commit
2c5de0a713
1 file changed
+4
@@ -387,6 +387,10 @@ impl TryInto<ServeConfig> for ServeConfigBuilder {
|
|||||||
|
|
||||||
/// Get the path to the public assets directory to serve static files from
|
/// Get the path to the public assets directory to serve static files from
|
||||||
pub(crate) fn public_path() -> PathBuf {
|
pub(crate) fn public_path() -> PathBuf {
|
||||||
|
if let Ok(path) = std::env::var("DIOXUS_PUBLIC_PATH") {
|
||||||
|
return PathBuf::from(path);
|
||||||
|
}
|
||||||
|
|
||||||
// The CLI always bundles static assets into the exe/public directory
|
// The CLI always bundles static assets into the exe/public directory
|
||||||
std::env::current_exe()
|
std::env::current_exe()
|
||||||
.expect("Failed to get current executable path")
|
.expect("Failed to get current executable path")
|
||||||
|
|||||||
Reference in new issue
Block a user