diff --git a/app/app.go b/app/app.go index 2c8d67c..ebf6a00 100644 --- a/app/app.go +++ b/app/app.go @@ -1,6 +1,7 @@ package app import ( + "flag" "fmt" "log" "proxmoxaas-dashboard/app/common" @@ -11,7 +12,10 @@ import ( "github.com/tdewolff/minify/v2" ) -func Run(configPath *string) { +func Run() { + configPath := flag.String("config", "config.json", "path to config.json file") + flag.Parse() + common.Global = common.GetConfig(*configPath) // setup static resources diff --git a/proxmoxaas-dashboard.go b/proxmoxaas-dashboard.go index 7d0cb60..0b70b51 100644 --- a/proxmoxaas-dashboard.go +++ b/proxmoxaas-dashboard.go @@ -1,12 +1,9 @@ package main import ( - "flag" app "proxmoxaas-dashboard/app" ) func main() { - configPath := flag.String("config", "config.json", "path to config.json file") - flag.Parse() - app.Run(configPath) + app.Run() }