Server repariert

This commit is contained in:
2026-07-25 16:59:46 +02:00
parent da4535ef1f
commit ceea3b74a5
4 changed files with 7 additions and 16 deletions
@@ -4,15 +4,13 @@
# password=<databaseUserPassword> dbname=<databaseName> # password=<databaseUserPassword> dbname=<databaseName>
[database] [database]
connection_string = “host=192.168.178.50 port=5432 user=tsindt connection_string = "host=192.168.178.50 port=5432 user=tsindt password=XD14ko8d dbname=simply_cpq_master_data sslmode=disable"
password=XD14ko8d dbname=simply_cpq_master_data sslmode=disable” driver_name = "postgres"
driver_name = “postgres”
################################################################ ################################################################
# HTTP server configuration # HTTP server configuration
[http] [http]
server_address = “:8080” server_address = ":8088"
################################################################ ################################################################
@@ -13,7 +13,7 @@ func InitConfig(fileName string) *viper.Viper {
config.AddConfigPath("$HOME") config.AddConfigPath("$HOME")
err := config.ReadInConfig() err := config.ReadInConfig()
if err != nil { if err != nil {
log.Fatal("Error while parsing configuration file", err) log.Fatal("Error while parsing configuration file! ", err)
} }
return config return config
} }
@@ -9,11 +9,11 @@ import (
func main() { func main() {
log.Println("Starting Simply CPQ Editor Service") log.Println("Starting Simply CPQ Editor Service")
log.Println("Reading configuration") log.Println("Reading configuration")
config.InitConfig("config") c := config.InitConfig("config")
log.Println("Initializing database") log.Println("Initializing database")
//dbHandler := server.InitDatabase(config) //dbHandler := server.InitDatabase(config)
log.Println("Initializing HTTP server") log.Println("Initializing HTTP server")
httpServer := server.InitHttpServer(config) httpServer := server.InitHttpServer(c)
httpServer.Start() httpServer.Start()
log.Println("Service Stopped") log.Println("Service Stopped")
@@ -16,13 +16,6 @@ type HttpServer struct {
func InitHttpServer(config *viper.Viper) HttpServer { func InitHttpServer(config *viper.Viper) HttpServer {
// Service API // Service API
router := gin.Default() 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) router.GET("/test", Test)
return HttpServer{ return HttpServer{
config: config, 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{ ctx.JSON(http.StatusOK, gin.H{
"message": "Test", "message": "Test",
}) })