Skip to content

Commit

Permalink
Fixed issue Raise error if waved cannot find public/private dir h2oai…
Browse files Browse the repository at this point in the history
  • Loading branch information
ShrirangB authored Dec 22, 2023
1 parent bf61b1c commit 18a6dd2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,19 @@ func Run(conf ServerConf) {
fileDir := filepath.Join(conf.DataDir, "f")
handle("_f/", newFileServer(fileDir, conf.Keychain, auth, conf.BaseURL+"_f"))
for _, dir := range conf.PrivateDirs {

checkDirectory(dir)

if err := checkDirectory(dir); err != nil {
log.Fatalf("Error checking private directory: %v", err)
}
prefix, src := splitDirMapping(dir)
echo(Log{"t": "private_dir", "source": src, "address": prefix})
handle(prefix, http.StripPrefix(conf.BaseURL+prefix, newDirServer(src, conf.Keychain, auth)))
}
for _, dir := range conf.PublicDirs {

checkDirectory(dir)
if err := checkDirectory(dir); err != nil {
log.Fatalf("Error checking public directory: %v", err)
}
prefix, src := splitDirMapping(dir)
echo(Log{"t": "public_dir", "source": src, "address": prefix})
handle(prefix, http.StripPrefix(conf.BaseURL+prefix, http.FileServer(http.Dir(src))))
Expand Down

0 comments on commit 18a6dd2

Please sign in to comment.