🐛 添加前端页面

This commit is contained in:
2024-10-02 23:00:59 +08:00
parent 33618b9d00
commit 3366248f74
2 changed files with 51 additions and 1 deletions

View File

@ -9,6 +9,7 @@ import (
"github.com/cloudwego/hertz/pkg/app/server"
"github.com/cloudwego/hertz/pkg/common/config"
"github.com/hertz-contrib/cors"
"os"
"server-status-be/api/backend"
"server-status-be/api/frontend"
)
@ -16,7 +17,11 @@ import (
var h *server.Hertz
func init() {
h = hertz.NewHertz([]config.Option{server.WithHostPorts(":8090")}, []app.HandlerFunc{})
port := os.Getenv("PORT")
if port == "" {
port = "8888"
}
h = hertz.NewHertz([]config.Option{server.WithHostPorts("0.0.0.0:" + port)}, []app.HandlerFunc{})
// cv api 状态客户端接口
h.Use(cors.Default())