refactor: remove shutdown button for Docker deployment
Docker 容器化部署是长期运行的服务,移除关闭服务按钮: - 删除前端 header.ts 中的关闭按钮 - 删除 main.go 中的 /api/shutdown 接口 - 删除 router.go 中的 quit 路由和处理函数 Co-Authored-By: AI
This commit is contained in:
@@ -7,7 +7,6 @@ import (
|
||||
"io/fs"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
"bilidown/internal/router"
|
||||
"bilidown/internal/util"
|
||||
@@ -59,13 +58,6 @@ func mustRunServer() {
|
||||
http.HandleFunc("/api/checkFFmpeg", func(w http.ResponseWriter, r *http.Request) {
|
||||
util.Res{Success: true, Data: map[string]bool{"available": ffmpegAvailable}}.Write(w)
|
||||
})
|
||||
// 添加关闭服务接口
|
||||
http.HandleFunc("/api/shutdown", func(w http.ResponseWriter, r *http.Request) {
|
||||
util.Res{Success: true, Message: "Shutting down..."}.Write(w)
|
||||
go func() {
|
||||
os.Exit(0)
|
||||
}()
|
||||
})
|
||||
http.Handle("/api/", http.StripPrefix("/api", apiRouter))
|
||||
// 启动 HTTP 服务器
|
||||
go func() {
|
||||
|
||||
Reference in New Issue
Block a user