Locate VHOST files
This code is obviously not sensible as it's not async
This commit is contained in:
parent
8d36ccff9f
commit
1f2d11c0ee
1 changed files with 12 additions and 0 deletions
12
src/main.rs
12
src/main.rs
|
@ -36,6 +36,18 @@ fn get_dokku_root() -> Option<PathBuf> {
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn hosts(State(state): State<AppState>) -> String {
|
async fn hosts(State(state): State<AppState>) -> String {
|
||||||
|
for vhost in state
|
||||||
|
.dokku_root
|
||||||
|
.read_dir()
|
||||||
|
.unwrap()
|
||||||
|
.filter_map(Result::ok)
|
||||||
|
.map(|entry| entry.path())
|
||||||
|
.filter(|path| path.is_dir())
|
||||||
|
.map(|path| path.join("VHOST"))
|
||||||
|
.filter(|path| path.is_file())
|
||||||
|
{
|
||||||
|
dbg!(vhost);
|
||||||
|
}
|
||||||
format!("{}", state.dokku_root.display())
|
format!("{}", state.dokku_root.display())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue