chore: add home_path to WebServer config and fix APP_HOME
This commit is contained in:
parent
b7733d50e4
commit
952a3fd661
5 changed files with 60 additions and 48 deletions
|
|
@ -11,8 +11,10 @@ use app_env::appenv::AppEnv;
|
|||
pub fn load_from_module(env: AppEnv, coll_key: &str) -> (String,String) {
|
||||
if let Some(module) = env.modules.get(coll_key) {
|
||||
match module.stores.to_owned().as_str() {
|
||||
"file" =>
|
||||
(module.store_frmt.to_owned(), load_fs_content(&module.store_root, &module.store_path, &module.store_frmt)),
|
||||
"file" => {
|
||||
let store_root =format!("{}/{}/{}",&envmnt::get_or("APP_HOME", ""),&env.get_curr_websrvr_config().home_path,&module.store_root);
|
||||
(module.store_frmt.to_owned(), load_fs_content(&store_root, &module.store_path, &module.store_frmt))
|
||||
},
|
||||
_ => {
|
||||
println!("Stores {} load not defined", &module.stores);
|
||||
(module.store_frmt.to_owned(), String::from(""))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue