wireguard-dashboard/main.go

29 lines
487 B
Go
Raw Normal View History

2024-03-05 16:59:37 +08:00
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())
}
}