|
|
|
@ -42,7 +42,6 @@ import (
|
|
|
|
|
// @BasePath /
|
|
|
|
|
func main() {
|
|
|
|
|
fmt.Println("api start ")
|
|
|
|
|
log.NewPrivateLog(constant.LogFileName)
|
|
|
|
|
gin.SetMode(gin.ReleaseMode)
|
|
|
|
|
f, _ := os.Create("../logs/api.log")
|
|
|
|
|
gin.DefaultWriter = io.MultiWriter(f)
|
|
|
|
@ -50,6 +49,7 @@ func main() {
|
|
|
|
|
r := gin.Default()
|
|
|
|
|
r.Use(utils.CorsHandler())
|
|
|
|
|
fmt.Println("load config: ", config.Config)
|
|
|
|
|
log.NewPrivateLog(constant.LogFileName)
|
|
|
|
|
r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
|
|
|
|
|
if config.Config.Prometheus.Enable {
|
|
|
|
|
r.GET("/metrics", promePkg.PrometheusHandler())
|
|
|
|
|