mirror of
https://github.com/snowykami/server-status-server.git
synced 2025-06-12 17:57:41 +00:00
🐛 添加前端页面
This commit is contained in:
parent
33618b9d00
commit
3366248f74
45
README.md
Normal file
45
README.md
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
<div align="center">
|
||||||
|
|
||||||
|
# server-status-server
|
||||||
|
|
||||||
|
_✨ 服务器状态 - 服务端/后端 ✨_
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
## 📖 介绍
|
||||||
|
|
||||||
|
服务器状态的服务端
|
||||||
|
|
||||||
|
## 💿 安装(还在推进)
|
||||||
|
|
||||||
|
### 从二进制文件安装
|
||||||
|
|
||||||
|
- 从 Release 下载对应平台的二进制文件
|
||||||
|
|
||||||
|
### Docker 安装
|
||||||
|
|
||||||
|
- 从 Docker Hub 下载镜像
|
||||||
|
docker pull liteyuki/server-status-server
|
||||||
|
|
||||||
|
### 自行编译
|
||||||
|
|
||||||
|
- 你无法自行编译,因为应用包含私有依赖
|
||||||
|
|
||||||
|
## 🎉 使用
|
||||||
|
|
||||||
|
### 配置
|
||||||
|
默认是通过传入环境变量来配置的,你可以通过创建 `.env` 文件来或者直接传入环境变量来配置
|
||||||
|
```dotenv
|
||||||
|
PORT=8080
|
||||||
|
TOKEN=114514
|
||||||
|
```
|
||||||
|
|
||||||
|
## 📝 其他
|
||||||
|
|
||||||
|
### 开机启动
|
||||||
|
|
||||||
|
- 手动安装请自行配置service通过systemd启动
|
||||||
|
|
||||||
|
### 主机监控
|
||||||
|
|
||||||
|
- 请在需要监控的服务器主机上安装 [server-status-client](../server-status-client)
|
@ -9,6 +9,7 @@ import (
|
|||||||
"github.com/cloudwego/hertz/pkg/app/server"
|
"github.com/cloudwego/hertz/pkg/app/server"
|
||||||
"github.com/cloudwego/hertz/pkg/common/config"
|
"github.com/cloudwego/hertz/pkg/common/config"
|
||||||
"github.com/hertz-contrib/cors"
|
"github.com/hertz-contrib/cors"
|
||||||
|
"os"
|
||||||
"server-status-be/api/backend"
|
"server-status-be/api/backend"
|
||||||
"server-status-be/api/frontend"
|
"server-status-be/api/frontend"
|
||||||
)
|
)
|
||||||
@ -16,7 +17,11 @@ import (
|
|||||||
var h *server.Hertz
|
var h *server.Hertz
|
||||||
|
|
||||||
func init() {
|
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 状态客户端接口
|
// cv api 状态客户端接口
|
||||||
h.Use(cors.Default())
|
h.Use(cors.Default())
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user