Merge pull request #537 from JunioCalu/make-embed-frontend-optional
fix embed frontend optional
This commit is contained in:
commit
02b4e9d964
@ -29,6 +29,9 @@ use api::{auth, routes::*};
|
||||
use db::{db_pool, models::LoginUser};
|
||||
use utils::{args_parse::Args, control::ProcessControl, db_path, init_config, run_args};
|
||||
|
||||
#[cfg(any(debug_assertions, not(feature = "embed_frontend")))]
|
||||
use utils::public_path;
|
||||
|
||||
use ffplayout_lib::utils::{init_logging, PlayoutConfig};
|
||||
|
||||
#[cfg(not(debug_assertions))]
|
||||
@ -178,11 +181,11 @@ async fn main() -> std::io::Result<()> {
|
||||
web_app.service(ResourceFiles::new("/", generated).resolve_not_found_to_root());
|
||||
}
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
#[cfg(any(debug_assertions, not(feature = "embed_frontend")))]
|
||||
{
|
||||
// in debug mode get frontend from path
|
||||
web_app = web_app.service(
|
||||
Files::new("/", "./ffplayout-frontend/.output/public/")
|
||||
Files::new("/", public_path())
|
||||
.index_file("index.html"),
|
||||
);
|
||||
}
|
||||
|
@ -169,6 +169,14 @@ pub fn public_path() -> PathBuf {
|
||||
return path;
|
||||
}
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
{
|
||||
let path = PathBuf::from("./ffplayout-frontend/.output/public/");
|
||||
if path.is_dir() {
|
||||
return path;
|
||||
}
|
||||
}
|
||||
|
||||
PathBuf::from("./public/")
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user