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>
[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"
################################################################
@@ -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
}
@@ -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")
@@ -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",
})