Join webbapp core modules into single package

This commit is contained in:
eleksir
2025-10-12 16:42:16 +03:00
parent 3932835d47
commit d5c6d5719a
12 changed files with 203 additions and 176 deletions

View File

@@ -0,0 +1,30 @@
package webapp
import (
"fmt"
"os"
"path/filepath"
)
func DefaultConfigFileLocations() ([]string, error) {
var locations []string
executablePath, err := os.Executable()
if err != nil {
return locations, fmt.Errorf("unable to get my executable path: %w", err)
}
configJSONPath := fmt.Sprintf("%s/data/config.json", filepath.Dir(executablePath))
locations = []string{
"~/.aleesa-webapp-go.json",
"~/aleesa-webapp-go.json",
"/etc/aleesa-webapp-go.json",
configJSONPath,
}
return locations, nil
}
/* vim: set ft=go noet ai ts=4 sw=4 sts=4: */