// Code generated by hertz generator. package main import ( "github.com/cloudwego/hertz/pkg/app/server" "github.com/hertz-contrib/cors" "pji_desktop_http/biz/dal" "pji_desktop_http/common/config" "pji_desktop_http/common/config/c_log" "pji_desktop_http/pji_client" ) func main() { dal.Init() c_log.InitLog("logs/", "desktop_http") config.InitOssConfig() pji_client.InitApiClient() //h := server.Default() h := server.New( server.WithStreamBody(true), ) h.Use(cors.New(cors.Config{ AllowOrigins: []string{"*"}, AllowMethods: []string{"POST, GET, OPTIONS, PUT, DELETE, UPDATE"}, AllowHeaders: []string{"Origin, X-Requested-With, Content-Type, Accept, Authorization"}, ExposeHeaders: []string{"Content-Length, Content-Disposition, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Cache-Control, Content-Language, Content-Type"}, AllowCredentials: true, })) register(h) h.Spin() }