Moved github PAT and storage path to env vars
This commit is contained in:
@@ -5,17 +5,18 @@ import (
|
||||
"path/filepath"
|
||||
"quay/app/handlers"
|
||||
"quay/internal/config"
|
||||
"quay/internal/envconfig"
|
||||
|
||||
"github.com/gofiber/fiber/v3"
|
||||
)
|
||||
|
||||
func Register(app *fiber.App, cfg *config.Config) {
|
||||
func Register(app *fiber.App, cfg *config.Config, envCfg *envconfig.EnvConfig) {
|
||||
api := app.Group("/api")
|
||||
api.Get("/health", handlers.HealthCheck)
|
||||
|
||||
api.Post("/update", handlers.NewUpdateSiteHandler(cfg))
|
||||
api.Post("/update", handlers.NewUpdateSiteHandler(cfg, envCfg))
|
||||
|
||||
storagePath, err := filepath.Abs(cfg.Global.StoragePath)
|
||||
storagePath, err := filepath.Abs(envCfg.StoragePath)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to resolve storage path: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user