fix: build

This commit is contained in:
2026-04-28 22:09:19 -04:00
parent fcfa43cca3
commit 4c1523d81b
9 changed files with 60 additions and 20 deletions

View File

@@ -13,19 +13,24 @@ import (
"reichard.io/aethera/web"
)
func StartServer(settingsStore store.Store, dataDir, listenAddress string, listenPort int) {
func StartServer(settingsStore store.Store, dataDir, staticDir, listenAddress string, listenPort int) {
mux := http.NewServeMux()
// Create API Instance - use settingsStore as the unified store for both settings and chat
logger := logrus.New()
api := api.New(settingsStore, dataDir, logger)
// Serve embedded static assets
staticFS, err := fs.Sub(web.Assets, "static")
if err != nil {
logrus.Fatal("Failed to create static filesystem: ", err)
// Serve Static Assets
if staticDir != "" {
logrus.Infof("Serving static assets from directory: %s", staticDir)
mux.Handle("GET /", http.FileServer(http.Dir(staticDir)))
} else {
staticFS, err := fs.Sub(web.Assets, "static")
if err != nil {
logrus.Fatal("Failed to create static filesystem: ", err)
}
mux.Handle("GET /", http.FileServer(http.FS(staticFS)))
}
mux.Handle("GET /", http.FileServer(http.FS(staticFS)))
// Serve Generated Data
genFS := http.FileServer(http.Dir(path.Join(dataDir, "generated")))