This commit is contained in:
coward
2024-03-05 16:59:37 +08:00
commit 0e20f5068e
13 changed files with 445 additions and 0 deletions

29
main.go Normal file
View File

@@ -0,0 +1,29 @@
package main
import (
"fmt"
"log"
"net/http"
"wireguard-dashboard/config"
"wireguard-dashboard/initialize"
"wireguard-dashboard/route"
)
func init() {
initialize.Init() // 初始化
}
func main() {
route.IncludeRouters()
handler := route.InitRouter()
httpServe := http.Server{
Addr: fmt.Sprintf(":%d", config.Config.Http.Port),
Handler: handler,
}
if err := httpServe.ListenAndServe(); err != nil {
log.Panicf("启动http服务端失败: %v", err.Error())
}
}