refactoring of code

This commit is contained in:
Jonas Kaninda
2024-11-15 15:42:02 +01:00
parent 5a6c30ec95
commit a5823890a8
5 changed files with 19 additions and 14 deletions

View File

@@ -37,13 +37,13 @@ var ServerCmd = &cobra.Command{
}
ctx := context.Background()
g := pkg.GatewayServer{}
gs, err := g.Config(configFile)
gs, err := g.Config(configFile, ctx)
if err != nil {
fmt.Printf("Could not load configuration: %v\n", err)
os.Exit(1)
}
gs.SetEnv()
if err := gs.Start(ctx); err != nil {
if err := gs.Start(); err != nil {
fmt.Printf("Could not start server: %v\n", err)
os.Exit(1)