监控网页实现

This commit is contained in:
Z
2026-04-09 00:14:57 +08:00
parent 6b1c7242c7
commit 1cce5634b1
17 changed files with 1186 additions and 38 deletions

View File

@@ -1,16 +1,16 @@
package main
import (
"log"
"hightube/internal/api"
"hightube/internal/chat"
"hightube/internal/db"
"hightube/internal/monitor"
"hightube/internal/stream"
)
func main() {
log.Println("Starting Hightube Server v1.0.0-Beta3.7...")
monitor.Init(2000)
monitor.Infof("Starting Hightube Server v1.0.0-Beta3.7")
// Initialize Database and run auto-migrations
db.InitDB()
@@ -23,15 +23,15 @@ func main() {
// Start the API server in a goroutine so it doesn't block the RTMP server
go func() {
r := api.SetupRouter(srv)
log.Println("[INFO] API Server is listening on :8080...")
monitor.Infof("API server listening on :8080")
if err := r.Run(":8080"); err != nil {
log.Fatalf("Failed to start API server: %v", err)
monitor.Errorf("Failed to start API server: %v", err)
}
}()
// Setup and start the RTMP server
log.Println("[INFO] Ready to receive RTMP streams from OBS.")
monitor.Infof("Ready to receive RTMP streams from OBS")
if err := srv.Start(":1935"); err != nil {
log.Fatalf("Failed to start RTMP server: %v", err)
monitor.Errorf("Failed to start RTMP server: %v", err)
}
}