Added static serving

This commit is contained in:
2026-03-30 20:34:27 +02:00
parent 42f9b974b2
commit a8a2b3f95a
5 changed files with 90 additions and 7 deletions
+14 -1
View File
@@ -1,6 +1,8 @@
package routes
import (
"log"
"path/filepath"
"quay/app/handlers"
"quay/internal/config"
@@ -9,6 +11,17 @@ import (
func Register(app *fiber.App, cfg *config.Config) {
api := app.Group("/api")
api.Get("/health", handlers.HealthCheck)
storagePath, err := filepath.Abs(cfg.Global.StoragePath)
if err != nil {
log.Fatalf("Failed to resolve storage path: %v", err)
}
siteMap := make(map[string]config.SiteConfig)
for _, site := range cfg.Sites {
siteMap[site.Domain] = site
}
app.Use(handlers.NewStaticHandler(storagePath, siteMap))
}