1
Fork 0

Locate VHOST files

This code is obviously not sensible as it's not async
This commit is contained in:
Jake Howard 2023-09-01 17:43:19 +01:00
parent 8d36ccff9f
commit 1f2d11c0ee
Signed by: jake
GPG Key ID: 57AFB45680EDD477
1 changed files with 12 additions and 0 deletions

View File

@ -36,6 +36,18 @@ fn get_dokku_root() -> Option<PathBuf> {
}
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())
}