package main

import (
	"fmt"
	"ziqian/config"
	"ziqian/router"
)

func main() {
	// 初始化配置
	cfg := config.GetConfig()

	// 设置路由
	r := router.SetupRouter()

	// 启动服务器
	addr := fmt.Sprintf(":%s", cfg.Gin.Port)
	fmt.Printf("server is running on %s\n", addr)
	if err := r.Run(addr); err != nil {
		fmt.Printf("start server error: %v\n", err)
	}
}