From ceea3b74a54a51f97c6ec15fc8a522dc7e7ac680 Mon Sep 17 00:00:00 2001 From: tsindt Date: Sat, 25 Jul 2026 16:59:46 +0200 Subject: [PATCH] Server repariert --- buildtime/server/src/scpq-editor-server/config.toml | 8 +++----- buildtime/server/src/scpq-editor-server/config/config.go | 2 +- buildtime/server/src/scpq-editor-server/main.go | 4 ++-- .../server/src/scpq-editor-server/server/httpServer.go | 9 +-------- 4 files changed, 7 insertions(+), 16 deletions(-) diff --git a/buildtime/server/src/scpq-editor-server/config.toml b/buildtime/server/src/scpq-editor-server/config.toml index 1d6285b64..97ad78f39 100644 --- a/buildtime/server/src/scpq-editor-server/config.toml +++ b/buildtime/server/src/scpq-editor-server/config.toml @@ -4,15 +4,13 @@ # password= dbname= [database] -connection_string = “host=192.168.178.50 port=5432 user=tsindt -password=XD14ko8d dbname=simply_cpq_master_data sslmode=disable” - -driver_name = “postgres” +connection_string = "host=192.168.178.50 port=5432 user=tsindt password=XD14ko8d dbname=simply_cpq_master_data sslmode=disable" +driver_name = "postgres" ################################################################ # HTTP server configuration [http] -server_address = “:8080” +server_address = ":8088" ################################################################ \ No newline at end of file diff --git a/buildtime/server/src/scpq-editor-server/config/config.go b/buildtime/server/src/scpq-editor-server/config/config.go index 64b63258f..5d1da62a6 100644 --- a/buildtime/server/src/scpq-editor-server/config/config.go +++ b/buildtime/server/src/scpq-editor-server/config/config.go @@ -13,7 +13,7 @@ func InitConfig(fileName string) *viper.Viper { config.AddConfigPath("$HOME") err := config.ReadInConfig() if err != nil { - log.Fatal("Error while parsing configuration file", err) + log.Fatal("Error while parsing configuration file! ", err) } return config } diff --git a/buildtime/server/src/scpq-editor-server/main.go b/buildtime/server/src/scpq-editor-server/main.go index 1244caad4..3fbcd7050 100644 --- a/buildtime/server/src/scpq-editor-server/main.go +++ b/buildtime/server/src/scpq-editor-server/main.go @@ -9,11 +9,11 @@ import ( func main() { log.Println("Starting Simply CPQ Editor Service") log.Println("Reading configuration") - config.InitConfig("config") + c := config.InitConfig("config") log.Println("Initializing database") //dbHandler := server.InitDatabase(config) log.Println("Initializing HTTP server") - httpServer := server.InitHttpServer(config) + httpServer := server.InitHttpServer(c) httpServer.Start() log.Println("Service Stopped") diff --git a/buildtime/server/src/scpq-editor-server/server/httpServer.go b/buildtime/server/src/scpq-editor-server/server/httpServer.go index 5ae446d75..b16716562 100644 --- a/buildtime/server/src/scpq-editor-server/server/httpServer.go +++ b/buildtime/server/src/scpq-editor-server/server/httpServer.go @@ -16,13 +16,6 @@ type HttpServer struct { func InitHttpServer(config *viper.Viper) HttpServer { // Service API router := gin.Default() - //router.POST(“/runner”, runnersController.CreateRunner) - //router.PUT(“/runner”, runnersController.UpdateRunner) - //router.DELETE(“/runner/:id”, runnersController.DeleteRunner) - //router.GET(“/runner/:id”, runnersController.GetRunner) - //router.GET(“/runner”, runnersController.GetRunnersBatch) - //router.POST(“/result”, resultsController.CreateResult) - //router.DELETE(“/result/:id”, resultsController.DeleteResult) router.GET("/test", Test) return HttpServer{ config: config, @@ -37,7 +30,7 @@ func (hs HttpServer) Start() { } } -func (hs HttpServer) Test(ctx *gin.Context) { +func Test(ctx *gin.Context) { ctx.JSON(http.StatusOK, gin.H{ "message": "Test", })