Website Mockup for X-CPQ Editor with Tailwind and DaisyUI

This commit is contained in:
2026-08-30 22:57:43 +02:00
parent fbd3d63d17
commit ac56c2a8e8
45 changed files with 6858 additions and 0 deletions
@@ -0,0 +1,56 @@
package server
import (
"database/sql"
"log"
"net/http"
"github.com/gin-contrib/cors"
"github.com/gin-gonic/gin"
"github.com/spf13/viper"
)
type HttpServer struct {
config *viper.Viper
router *gin.Engine
dbHandler *sql.DB
}
func InitHttpServer(config *viper.Viper, dbHandler *sql.DB) HttpServer {
// repository initialisation:
// service initialisation:
// controller initialisation:
// Service API
router := gin.Default()
router.Use(cors.Default())
// static content
router.Static("/static", "../static")
router.StaticFile("/", "./static/index.html")
router.GET("/test", Test)
// server
return HttpServer{
config: config,
router: router,
dbHandler: dbHandler,
}
}
func (hs HttpServer) Start() {
err := hs.router.Run(hs.config.GetString("http.server_address"))
if err != nil {
log.Fatalf("Error while starting HTTP server: %v", err)
}
}
func Test(ctx *gin.Context) {
ctx.JSON(http.StatusOK, gin.H{
"message": "Test",
})
}