Add frontend #1

Merged
KartoffelChipss merged 50 commits from feature/frontend into main 2026-05-06 20:16:59 +02:00
2 changed files with 14 additions and 14 deletions
Showing only changes of commit 2931729f97 - Show all commits
+1 -1
View File
@@ -21,7 +21,7 @@ func Register(app *fiber.App, cfg *config.Config, envCfg *envconfig.EnvConfig, d
updateSiteHandler := handlers.NewUpdateSiteHandler(cfg, envCfg)
siteHandler := handlers.NewSiteHandler(siteRepository)
api := app.Group("/api/v1", middleware.APIHostGuard(envCfg.ApiHost))
api := app.Group("/api/v1", middleware.APIHostGuard(envCfg.DashboardHost))
api.Get("/health", handlers.HealthCheck)
api.Post("/update", updateSiteHandler.PostUpdate)
+13 -13
View File
@@ -5,11 +5,11 @@ import (
)
type EnvConfig struct {
Port string
ConfigDir string
GithubPat string
StoragePath string
ApiHost string
Port string
ConfigDir string
GithubPat string
StoragePath string
DashboardHost string
}
func Load() EnvConfig {
@@ -33,16 +33,16 @@ func Load() EnvConfig {
storagePath = "./storage"
}
apiHost := os.Getenv("API_HOST")
if apiHost == "" {
apiHost = "localhost"
dashboardHost := os.Getenv("DASHBOARD_HOST")
if dashboardHost == "" {
dashboardHost = "localhost"
}
return EnvConfig{
Port: port,
ConfigDir: configDir,
GithubPat: githubPat,
StoragePath: storagePath,
ApiHost: apiHost,
Port: port,
ConfigDir: configDir,
GithubPat: githubPat,
StoragePath: storagePath,
DashboardHost: dashboardHost,
}
}