move flag parsing to app.go

This commit is contained in:
2026-06-02 18:00:24 +00:00
parent 0082f2f3e5
commit f40638598d
2 changed files with 6 additions and 5 deletions
+5 -1
View File
@@ -1,6 +1,7 @@
package app package app
import ( import (
"flag"
"fmt" "fmt"
"log" "log"
"proxmoxaas-dashboard/app/common" "proxmoxaas-dashboard/app/common"
@@ -11,7 +12,10 @@ import (
"github.com/tdewolff/minify/v2" "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) common.Global = common.GetConfig(*configPath)
// setup static resources // setup static resources
+1 -4
View File
@@ -1,12 +1,9 @@
package main package main
import ( import (
"flag"
app "proxmoxaas-dashboard/app" app "proxmoxaas-dashboard/app"
) )
func main() { func main() {
configPath := flag.String("config", "config.json", "path to config.json file") app.Run()
flag.Parse()
app.Run(configPath)
} }