mirror of
https://github.com/snowykami/server-status-server.git
synced 2025-09-06 12:06:26 +00:00
🐛 添加前端页面
This commit is contained in:
@ -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())
|
||||
|
||||
|
Reference in New Issue
Block a user